Repository: randombit/botan
Pull request #3273 (2023-02-11 18:39:48)

Patches to enable GCC 4.7 to compile Botan2
Wasn't so bad actually.

Have only tested this on a MIPS box (only machine I can find that still has GCC 4.7 installed) so there may be little problems in x86-specific code.

#3268 


Patch:
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index 711c48f76..17700c019 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -4,13 +4,13 @@ binary_name g++
 
 lang_flags "-std=c++11 -D_REENTRANT"
 
-# This should only contain flags which are included in GCC 4.8
-warning_flags "-Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor"
+# This should only contain flags which are included in GCC 4.7
+warning_flags "-Wall -Wextra -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor"
 
 # Boost headers have 0 as nullptr and non-virtual-dtor issues so we can't werror on them
 werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor"
 
-maintainer_warning_flags "-Wstrict-overflow=5 -Wold-style-cast -Wsuggest-override -Wshadow -Wextra-semi"
+maintainer_warning_flags "-Wpedantic -Wstrict-overflow=5 -Wold-style-cast -Wsuggest-override -Wshadow -Wextra-semi"
 
 optimization_flags "-O3"
 sanitizer_optimization_flags "-O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer"
diff --git a/src/cli/cli_exceptions.h b/src/cli/cli_exceptions.h
index c88d17027..4869bd6e3 100644
--- a/src/cli/cli_exceptions.h
+++ b/src/cli/cli_exceptions.h
@@ -7,6 +7,8 @@
 #ifndef BOTAN_CLI_EXCEPTIONS_H_
 #define BOTAN_CLI_EXCEPTIONS_H_
 
+#include <stdexcept>
+
 namespace Botan_CLI {
 
 class CLI_Error : public std::runtime_error
diff --git a/src/cli/tls_http_server.cpp b/src/cli/tls_http_server.cpp
index aaf740fcf..fc0b5bbb7 100644
--- a/src/cli/tls_http_server.cpp
+++ b/src/cli/tls_http_server.cpp
@@ -106,7 +106,7 @@ class HTTP_Parser final
          {
          public:
             virtual void handle_http_request(const Request& request) = 0;
-            virtual ~Callbacks() = default;
+            virtual ~Callbacks() {}
          };
 
       HTTP_Parser(Callbacks& cb) : m_cb(cb) {}
diff --git a/src/lib/asn1/asn1_obj.h b/src/lib/asn1/asn1_obj.h
index 0ce443771..e0875b6eb 100644
--- a/src/lib/asn1/asn1_obj.h
+++ b/src/lib/asn1/asn1_obj.h
@@ -90,7 +90,7 @@ class BOTAN_PUBLIC_API(2,0) ASN1_Object
       ASN1_Object() = default;
       ASN1_Object(const ASN1_Object&) = default;
       ASN1_Object & operator=(const ASN1_Object&) = default;
-      virtual ~ASN1_Object() = default;
+      virtual ~ASN1_Object() {}
    };
 
 /**
diff --git a/src/lib/asn1/asn1_print.h b/src/lib/asn1/asn1_print.h
index a6bc6b15f..a30ff1af0 100644
--- a/src/lib/asn1/asn1_print.h
+++ b/src/lib/asn1/asn1_print.h
@@ -22,7 +22,7 @@ class BER_Decoder;
 class BOTAN_PUBLIC_API(2,4) ASN1_Formatter
    {
    public:
-      virtual ~ASN1_Formatter() = default;
+      virtual ~ASN1_Formatter() {}
 
       /**
       * @param print_context_specific if true, try to parse nested context specific data.
diff --git a/src/lib/base/buf_comp.h b/src/lib/base/buf_comp.h
index 31bf48529..5e2c417c9 100644
--- a/src/lib/base/buf_comp.h
+++ b/src/lib/base/buf_comp.h
@@ -157,7 +157,7 @@ class BOTAN_PUBLIC_API(2,0) Buffered_Computation
          return final();
          }
 
-      virtual ~Buffered_Computation() = default;
+      virtual ~Buffered_Computation() {}
    private:
       /**
       * Add more data to the computation
diff --git a/src/lib/base/sym_algo.h b/src/lib/base/sym_algo.h
index 41d999292..53fcfb51e 100644
--- a/src/lib/base/sym_algo.h
+++ b/src/lib/base/sym_algo.h
@@ -102,7 +102,7 @@ class BOTAN_PUBLIC_API(2,0) Key_Length_Specification final
 class BOTAN_PUBLIC_API(2,0) SymmetricAlgorithm
    {
    public:
-      virtual ~SymmetricAlgorithm() = default;
+      virtual ~SymmetricAlgorithm() {}
 
       /**
       * Reset the state.
diff --git a/src/lib/block/aria/aria.cpp b/src/lib/block/aria/aria.cpp
index 79105a88c..f55b3b4f2 100644
--- a/src/lib/block/aria/aria.cpp
+++ b/src/lib/block/aria/aria.cpp
@@ -27,7 +27,7 @@ namespace {
 
 namespace ARIA_F {
 
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint32_t S1[256]={
    0x00636363,0x007c7c7c,0x00777777,0x007b7b7b,0x00f2f2f2,0x006b6b6b,0x006f6f6f,0x00c5c5c5,
    0x00303030,0x00010101,0x00676767,0x002b2b2b,0x00fefefe,0x00d7d7d7,0x00ababab,0x00767676,
@@ -63,7 +63,7 @@ const uint32_t S1[256]={
    0x00414141,0x00999999,0x002d2d2d,0x000f0f0f,0x00b0b0b0,0x00545454,0x00bbbbbb,0x00161616
 };
 
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint32_t S2[256]={
    0xe200e2e2,0x4e004e4e,0x54005454,0xfc00fcfc,0x94009494,0xc200c2c2,0x4a004a4a,0xcc00cccc,
    0x62006262,0x0d000d0d,0x6a006a6a,0x46004646,0x3c003c3c,0x4d004d4d,0x8b008b8b,0xd100d1d1,
@@ -99,7 +99,7 @@ const uint32_t S2[256]={
    0x89008989,0xde00dede,0x71007171,0x1a001a1a,0xaf00afaf,0xba00baba,0xb500b5b5,0x81008181
 };
 
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint32_t X1[256]={
    0x52520052,0x09090009,0x6a6a006a,0xd5d500d5,0x30300030,0x36360036,0xa5a500a5,0x38380038,
    0xbfbf00bf,0x40400040,0xa3a300a3,0x9e9e009e,0x81810081,0xf3f300f3,0xd7d700d7,0xfbfb00fb,
@@ -135,7 +135,7 @@ const uint32_t X1[256]={
    0xe1e100e1,0x69690069,0x14140014,0x63630063,0x55550055,0x21210021,0x0c0c000c,0x7d7d007d
 };
 
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint32_t X2[256]={
    0x30303000,0x68686800,0x99999900,0x1b1b1b00,0x87878700,0xb9b9b900,0x21212100,0x78787800,
    0x50505000,0x39393900,0xdbdbdb00,0xe1e1e100,0x72727200,0x09090900,0x62626200,0x3c3c3c00,
diff --git a/src/lib/block/block_cipher.h b/src/lib/block/block_cipher.h
index 68cdd1afe..9942543ac 100644
--- a/src/lib/block/block_cipher.h
+++ b/src/lib/block/block_cipher.h
@@ -195,7 +195,7 @@ class BOTAN_PUBLIC_API(2,0) BlockCipher : public SymmetricAlgorithm
       */
       virtual BlockCipher* clone() const = 0;
 
-      virtual ~BlockCipher() = default;
+      virtual ~BlockCipher() {}
    };
 
 /**
diff --git a/src/lib/block/camellia/camellia.cpp b/src/lib/block/camellia/camellia.cpp
index 557b3012d..b4b386d21 100644
--- a/src/lib/block/camellia/camellia.cpp
+++ b/src/lib/block/camellia/camellia.cpp
@@ -13,7 +13,7 @@ namespace Botan {
 
 namespace {
 
-alignas(64) const uint64_t Camellia_SBOX1[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX1[256] = {
 0x7070700070000070, 0x8282820082000082, 0x2C2C2C002C00002C, 0xECECEC00EC0000EC,
 0xB3B3B300B30000B3, 0x2727270027000027, 0xC0C0C000C00000C0, 0xE5E5E500E50000E5,
 0xE4E4E400E40000E4, 0x8585850085000085, 0x5757570057000057, 0x3535350035000035,
@@ -79,7 +79,7 @@ alignas(64) const uint64_t Camellia_SBOX1[256] = {
 0x1515150015000015, 0xE3E3E300E30000E3, 0xADADAD00AD0000AD, 0xF4F4F400F40000F4,
 0x7777770077000077, 0xC7C7C700C70000C7, 0x8080800080000080, 0x9E9E9E009E00009E };
 
-alignas(64) const uint64_t Camellia_SBOX2[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX2[256] = {
 0x00E0E0E0E0E00000, 0x0005050505050000, 0x0058585858580000, 0x00D9D9D9D9D90000,
 0x0067676767670000, 0x004E4E4E4E4E0000, 0x0081818181810000, 0x00CBCBCBCBCB0000,
 0x00C9C9C9C9C90000, 0x000B0B0B0B0B0000, 0x00AEAEAEAEAE0000, 0x006A6A6A6A6A0000,
@@ -145,7 +145,7 @@ alignas(64) const uint64_t Camellia_SBOX2[256] = {
 0x002A2A2A2A2A0000, 0x00C7C7C7C7C70000, 0x005B5B5B5B5B0000, 0x00E9E9E9E9E90000,
 0x00EEEEEEEEEE0000, 0x008F8F8F8F8F0000, 0x0001010101010000, 0x003D3D3D3D3D0000 };
 
-alignas(64) const uint64_t Camellia_SBOX3[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX3[256] = {
 0x3800383800383800, 0x4100414100414100, 0x1600161600161600, 0x7600767600767600,
 0xD900D9D900D9D900, 0x9300939300939300, 0x6000606000606000, 0xF200F2F200F2F200,
 0x7200727200727200, 0xC200C2C200C2C200, 0xAB00ABAB00ABAB00, 0x9A009A9A009A9A00,
@@ -211,7 +211,7 @@ alignas(64) const uint64_t Camellia_SBOX3[256] = {
 0x8A008A8A008A8A00, 0xF100F1F100F1F100, 0xD600D6D600D6D600, 0x7A007A7A007A7A00,
 0xBB00BBBB00BBBB00, 0xE300E3E300E3E300, 0x4000404000404000, 0x4F004F4F004F4F00 };
 
-alignas(64) const uint64_t Camellia_SBOX4[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX4[256] = {
 0x7070007000007070, 0x2C2C002C00002C2C, 0xB3B300B30000B3B3, 0xC0C000C00000C0C0,
 0xE4E400E40000E4E4, 0x5757005700005757, 0xEAEA00EA0000EAEA, 0xAEAE00AE0000AEAE,
 0x2323002300002323, 0x6B6B006B00006B6B, 0x4545004500004545, 0xA5A500A50000A5A5,
@@ -277,7 +277,7 @@ alignas(64) const uint64_t Camellia_SBOX4[256] = {
 0x2828002800002828, 0x7B7B007B00007B7B, 0xC9C900C90000C9C9, 0xC1C100C10000C1C1,
 0xE3E300E30000E3E3, 0xF4F400F40000F4F4, 0xC7C700C70000C7C7, 0x9E9E009E00009E9E };
 
-alignas(64) const uint64_t Camellia_SBOX5[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX5[256] = {
 0x00E0E0E000E0E0E0, 0x0005050500050505, 0x0058585800585858, 0x00D9D9D900D9D9D9,
 0x0067676700676767, 0x004E4E4E004E4E4E, 0x0081818100818181, 0x00CBCBCB00CBCBCB,
 0x00C9C9C900C9C9C9, 0x000B0B0B000B0B0B, 0x00AEAEAE00AEAEAE, 0x006A6A6A006A6A6A,
@@ -343,7 +343,7 @@ alignas(64) const uint64_t Camellia_SBOX5[256] = {
 0x002A2A2A002A2A2A, 0x00C7C7C700C7C7C7, 0x005B5B5B005B5B5B, 0x00E9E9E900E9E9E9,
 0x00EEEEEE00EEEEEE, 0x008F8F8F008F8F8F, 0x0001010100010101, 0x003D3D3D003D3D3D };
 
-alignas(64) const uint64_t Camellia_SBOX6[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX6[256] = {
 0x3800383838003838, 0x4100414141004141, 0x1600161616001616, 0x7600767676007676,
 0xD900D9D9D900D9D9, 0x9300939393009393, 0x6000606060006060, 0xF200F2F2F200F2F2,
 0x7200727272007272, 0xC200C2C2C200C2C2, 0xAB00ABABAB00ABAB, 0x9A009A9A9A009A9A,
@@ -409,7 +409,7 @@ alignas(64) const uint64_t Camellia_SBOX6[256] = {
 0x8A008A8A8A008A8A, 0xF100F1F1F100F1F1, 0xD600D6D6D600D6D6, 0x7A007A7A7A007A7A,
 0xBB00BBBBBB00BBBB, 0xE300E3E3E300E3E3, 0x4000404040004040, 0x4F004F4F4F004F4F };
 
-alignas(64) const uint64_t Camellia_SBOX7[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX7[256] = {
 0x7070007070700070, 0x2C2C002C2C2C002C, 0xB3B300B3B3B300B3, 0xC0C000C0C0C000C0,
 0xE4E400E4E4E400E4, 0x5757005757570057, 0xEAEA00EAEAEA00EA, 0xAEAE00AEAEAE00AE,
 0x2323002323230023, 0x6B6B006B6B6B006B, 0x4545004545450045, 0xA5A500A5A5A500A5,
@@ -475,7 +475,7 @@ alignas(64) const uint64_t Camellia_SBOX7[256] = {
 0x2828002828280028, 0x7B7B007B7B7B007B, 0xC9C900C9C9C900C9, 0xC1C100C1C1C100C1,
 0xE3E300E3E3E300E3, 0xF4F400F4F4F400F4, 0xC7C700C7C7C700C7, 0x9E9E009E9E9E009E };
 
-alignas(64) const uint64_t Camellia_SBOX8[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Camellia_SBOX8[256] = {
 0x7070700070707000, 0x8282820082828200, 0x2C2C2C002C2C2C00, 0xECECEC00ECECEC00,
 0xB3B3B300B3B3B300, 0x2727270027272700, 0xC0C0C000C0C0C000, 0xE5E5E500E5E5E500,
 0xE4E4E400E4E4E400, 0x8585850085858500, 0x5757570057575700, 0x3535350035353500,
@@ -550,7 +550,7 @@ namespace Camellia_F {
 */
 uint64_t F_SLOW(uint64_t v, uint64_t K)
    {
-   alignas(64)
+   BOTAN_ALIGNAS(64)
    static const uint8_t SBOX[256] = {
       0x70, 0x82, 0x2C, 0xEC, 0xB3, 0x27, 0xC0, 0xE5, 0xE4, 0x85, 0x57,
       0x35, 0xEA, 0x0C, 0xAE, 0x41, 0x23, 0xEF, 0x6B, 0x93, 0x45, 0x19,
diff --git a/src/lib/block/cast128/cast128.cpp b/src/lib/block/cast128/cast128.cpp
index bcb273be7..068472d62 100644
--- a/src/lib/block/cast128/cast128.cpp
+++ b/src/lib/block/cast128/cast128.cpp
@@ -238,7 +238,7 @@ void CAST_128::clear()
 void CAST_128::cast_ks(secure_vector<uint32_t>& K,
                        secure_vector<uint32_t>& X)
    {
-   alignas(64) static const uint32_t S5[256] = {
+   BOTAN_ALIGNAS(64) static const uint32_t S5[256] = {
       0x7EC90C04, 0x2C6E74B9, 0x9B0E66DF, 0xA6337911, 0xB86A7FFF, 0x1DD358F5,
       0x44DD9D44, 0x1731167F, 0x08FBF1FA, 0xE7F511CC, 0xD2051B00, 0x735ABA00,
       0x2AB722D8, 0x386381CB, 0xACF6243A, 0x69BEFD7A, 0xE6A2E77F, 0xF0C720CD,
@@ -283,7 +283,7 @@ void CAST_128::cast_ks(secure_vector<uint32_t>& K,
       0x34010718, 0xBB30CAB8, 0xE822FE15, 0x88570983, 0x750E6249, 0xDA627E55,
       0x5E76FFA8, 0xB1534546, 0x6D47DE08, 0xEFE9E7D4 };
 
-   alignas(64) static const uint32_t S6[256] = {
+   BOTAN_ALIGNAS(64) static const uint32_t S6[256] = {
       0xF6FA8F9D, 0x2CAC6CE1, 0x4CA34867, 0xE2337F7C, 0x95DB08E7, 0x016843B4,
       0xECED5CBC, 0x325553AC, 0xBF9F0960, 0xDFA1E2ED, 0x83F0579D, 0x63ED86B9,
       0x1AB6A6B8, 0xDE5EBE39, 0xF38FF732, 0x8989B138, 0x33F14961, 0xC01937BD,
@@ -328,7 +328,7 @@ void CAST_128::cast_ks(secure_vector<uint32_t>& K,
       0xB0E93524, 0xBEBB8FBD, 0xA2D762CF, 0x49C92F54, 0x38B5F331, 0x7128A454,
       0x48392905, 0xA65B1DB8, 0x851C97BD, 0xD675CF2F };
 
-   alignas(64) static const uint32_t S7[256] = {
+   BOTAN_ALIGNAS(64) static const uint32_t S7[256] = {
       0x85E04019, 0x332BF567, 0x662DBFFF, 0xCFC65693, 0x2A8D7F6F, 0xAB9BC912,
       0xDE6008A1, 0x2028DA1F, 0x0227BCE7, 0x4D642916, 0x18FAC300, 0x50F18B82,
       0x2CB2CB11, 0xB232E75C, 0x4B3695F2, 0xB28707DE, 0xA05FBCF6, 0xCD4181E9,
@@ -373,7 +373,7 @@ void CAST_128::cast_ks(secure_vector<uint32_t>& K,
       0xC3C0BDAE, 0x4958C24C, 0x518F36B2, 0x84B1D370, 0x0FEDCE83, 0x878DDADA,
       0xF2A279C7, 0x94E01BE8, 0x90716F4B, 0x954B8AA3 };
 
-   alignas(64) static const uint32_t S8[256] = {
+   BOTAN_ALIGNAS(64) static const uint32_t S8[256] = {
       0xE216300D, 0xBBDDFFFC, 0xA7EBDABD, 0x35648095, 0x7789F8B7, 0xE6C1121B,
       0x0E241600, 0x052CE8B5, 0x11A9CFB0, 0xE5952F11, 0xECE7990A, 0x9386D174,
       0x2A42931C, 0x76E38111, 0xB12DEF3A, 0x37DDDDFC, 0xDE9ADEB1, 0x0A0CC32C,
diff --git a/src/lib/block/cast128/cast_sboxes.h b/src/lib/block/cast128/cast_sboxes.h
index f4d005cc9..81a936719 100644
--- a/src/lib/block/cast128/cast_sboxes.h
+++ b/src/lib/block/cast128/cast_sboxes.h
@@ -12,7 +12,7 @@
 
 namespace Botan {
 
-alignas(64) const uint32_t CAST_SBOX1[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CAST_SBOX1[256] = {
    0x30FB40D4, 0x9FA0FF0B, 0x6BECCD2F, 0x3F258C7A, 0x1E213F2F, 0x9C004DD3,
    0x6003E540, 0xCF9FC949, 0xBFD4AF27, 0x88BBBDB5, 0xE2034090, 0x98D09675,
    0x6E63A0E0, 0x15C361D2, 0xC2E7661D, 0x22D4FF8E, 0x28683B6F, 0xC07FD059,
@@ -57,7 +57,7 @@ alignas(64) const uint32_t CAST_SBOX1[256] = {
    0xB141AB08, 0x7CCA89B9, 0x1A69E783, 0x02CC4843, 0xA2F7C579, 0x429EF47D,
    0x427B169C, 0x5AC9F049, 0xDD8F0F00, 0x5C8165BF };
 
-alignas(64) const uint32_t CAST_SBOX2[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CAST_SBOX2[256] = {
    0x1F201094, 0xEF0BA75B, 0x69E3CF7E, 0x393F4380, 0xFE61CF7A, 0xEEC5207A,
    0x55889C94, 0x72FC0651, 0xADA7EF79, 0x4E1D7235, 0xD55A63CE, 0xDE0436BA,
    0x99C430EF, 0x5F0C0794, 0x18DCDB7D, 0xA1D6EFF3, 0xA0B52F7B, 0x59E83605,
@@ -102,7 +102,7 @@ alignas(64) const uint32_t CAST_SBOX2[256] = {
    0x5C038323, 0x3E5D3BB9, 0x43D79572, 0x7E6DD07C, 0x06DFDF1E, 0x6C6CC4EF,
    0x7160A539, 0x73BFBE70, 0x83877605, 0x4523ECF1 };
 
-alignas(64) const uint32_t CAST_SBOX3[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CAST_SBOX3[256] = {
    0x8DEFC240, 0x25FA5D9F, 0xEB903DBF, 0xE810C907, 0x47607FFF, 0x369FE44B,
    0x8C1FC644, 0xAECECA90, 0xBEB1F9BF, 0xEEFBCAEA, 0xE8CF1950, 0x51DF07AE,
    0x920E8806, 0xF0AD0548, 0xE13C8D83, 0x927010D5, 0x11107D9F, 0x07647DB9,
@@ -147,7 +147,7 @@ alignas(64) const uint32_t CAST_SBOX3[256] = {
    0x52BCE688, 0x1B03588A, 0xF7BAEFD5, 0x4142ED9C, 0xA4315C11, 0x83323EC5,
    0xDFEF4636, 0xA133C501, 0xE9D3531C, 0xEE353783 };
 
-alignas(64) const uint32_t CAST_SBOX4[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CAST_SBOX4[256] = {
    0x9DB30420, 0x1FB6E9DE, 0xA7BE7BEF, 0xD273A298, 0x4A4F7BDB, 0x64AD8C57,
    0x85510443, 0xFA020ED1, 0x7E287AFF, 0xE60FB663, 0x095F35A1, 0x79EBF120,
    0xFD059D43, 0x6497B7B1, 0xF3641F63, 0x241E4ADF, 0x28147F5F, 0x4FA2B8CD,
diff --git a/src/lib/block/des/des_tab.cpp b/src/lib/block/des/des_tab.cpp
index cb6ab4e7e..15f6173f5 100644
--- a/src/lib/block/des/des_tab.cpp
+++ b/src/lib/block/des/des_tab.cpp
@@ -9,7 +9,7 @@
 
 namespace Botan {
 
-alignas(64) const uint32_t DES_SPBOX1[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX1[256] = {
    0x01010400, 0x00000000, 0x00010000, 0x01010404, 0x01010004, 0x00010404,
    0x00000004, 0x00010000, 0x00000400, 0x01010400, 0x01010404, 0x00000400,
    0x01000404, 0x01010004, 0x01000000, 0x00000004, 0x00000404, 0x01000400,
@@ -54,7 +54,7 @@ alignas(64) const uint32_t DES_SPBOX1[256] = {
    0x00010404, 0x01010400, 0x00000404, 0x01000400, 0x01000400, 0x00000000,
    0x00010004, 0x00010400, 0x00000000, 0x01010004 };
 
-alignas(64) const uint32_t DES_SPBOX2[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX2[256] = {
    0x80108020, 0x80008000, 0x00008000, 0x00108020, 0x00100000, 0x00000020,
    0x80100020, 0x80008020, 0x80000020, 0x80108020, 0x80108000, 0x80000000,
    0x80008000, 0x00100000, 0x00000020, 0x80100020, 0x00108000, 0x00100020,
@@ -99,7 +99,7 @@ alignas(64) const uint32_t DES_SPBOX2[256] = {
    0x80000020, 0x00100020, 0x00108000, 0x00000000, 0x80008000, 0x00008020,
    0x80000000, 0x80100020, 0x80108020, 0x00108000 };
 
-alignas(64) const uint32_t DES_SPBOX3[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX3[256] = {
    0x00000208, 0x08020200, 0x00000000, 0x08020008, 0x08000200, 0x00000000,
    0x00020208, 0x08000200, 0x00020008, 0x08000008, 0x08000008, 0x00020000,
    0x08020208, 0x00020008, 0x08020000, 0x00000208, 0x08000000, 0x00000008,
@@ -144,7 +144,7 @@ alignas(64) const uint32_t DES_SPBOX3[256] = {
    0x00020200, 0x08000008, 0x08020000, 0x08000208, 0x00000208, 0x08020000,
    0x00020208, 0x00000008, 0x08020008, 0x00020200 };
 
-alignas(64) const uint32_t DES_SPBOX4[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX4[256] = {
    0x00802001, 0x00002081, 0x00002081, 0x00000080, 0x00802080, 0x00800081,
    0x00800001, 0x00002001, 0x00000000, 0x00802000, 0x00802000, 0x00802081,
    0x00000081, 0x00000000, 0x00800080, 0x00800001, 0x00000001, 0x00002000,
@@ -189,7 +189,7 @@ alignas(64) const uint32_t DES_SPBOX4[256] = {
    0x00802080, 0x00800081, 0x00002001, 0x00002080, 0x00800000, 0x00802001,
    0x00000080, 0x00800000, 0x00002000, 0x00802080 };
 
-alignas(64) const uint32_t DES_SPBOX5[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX5[256] = {
    0x00000100, 0x02080100, 0x02080000, 0x42000100, 0x00080000, 0x00000100,
    0x40000000, 0x02080000, 0x40080100, 0x00080000, 0x02000100, 0x40080100,
    0x42000100, 0x42080000, 0x00080100, 0x40000000, 0x02000000, 0x40080000,
@@ -234,7 +234,7 @@ alignas(64) const uint32_t DES_SPBOX5[256] = {
    0x40080000, 0x42000000, 0x00080100, 0x02000100, 0x40000100, 0x00080000,
    0x00000000, 0x40080000, 0x02080100, 0x40000100 };
 
-alignas(64) const uint32_t DES_SPBOX6[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX6[256] = {
    0x20000010, 0x20400000, 0x00004000, 0x20404010, 0x20400000, 0x00000010,
    0x20404010, 0x00400000, 0x20004000, 0x00404010, 0x00400000, 0x20000010,
    0x00400010, 0x20004000, 0x20000000, 0x00004010, 0x00000000, 0x00400010,
@@ -279,7 +279,7 @@ alignas(64) const uint32_t DES_SPBOX6[256] = {
    0x20400000, 0x00404010, 0x00004000, 0x00400010, 0x20004010, 0x00000000,
    0x20404000, 0x20000000, 0x00400010, 0x20004010 };
 
-alignas(64) const uint32_t DES_SPBOX7[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX7[256] = {
    0x00200000, 0x04200002, 0x04000802, 0x00000000, 0x00000800, 0x04000802,
    0x00200802, 0x04200800, 0x04200802, 0x00200000, 0x00000000, 0x04000002,
    0x00000002, 0x04000000, 0x04200002, 0x00000802, 0x04000800, 0x00200802,
@@ -324,7 +324,7 @@ alignas(64) const uint32_t DES_SPBOX7[256] = {
    0x00000002, 0x04200802, 0x00000000, 0x00200802, 0x04200000, 0x00000800,
    0x04000002, 0x04000800, 0x00000800, 0x00200002 };
 
-alignas(64) const uint32_t DES_SPBOX8[256] = {
+BOTAN_ALIGNAS(64) const uint32_t DES_SPBOX8[256] = {
    0x10001040, 0x00001000, 0x00040000, 0x10041040, 0x10000000, 0x10001040,
    0x00000040, 0x10000000, 0x00040040, 0x10040000, 0x10041040, 0x00041000,
    0x10041000, 0x00041040, 0x00001000, 0x00000040, 0x10040000, 0x10000040,
diff --git a/src/lib/block/kasumi/kasumi.cpp b/src/lib/block/kasumi/kasumi.cpp
index 819567b1c..37bb43b12 100644
--- a/src/lib/block/kasumi/kasumi.cpp
+++ b/src/lib/block/kasumi/kasumi.cpp
@@ -16,7 +16,7 @@ namespace {
 /*
 * KASUMI S-Boxes
 */
-alignas(64) const uint8_t KASUMI_SBOX_S7[128] = {
+BOTAN_ALIGNAS(64) const uint8_t KASUMI_SBOX_S7[128] = {
    0x36, 0x32, 0x3E, 0x38, 0x16, 0x22, 0x5E, 0x60, 0x26, 0x06, 0x3F, 0x5D,
    0x02, 0x12, 0x7B, 0x21, 0x37, 0x71, 0x27, 0x72, 0x15, 0x43, 0x41, 0x0C,
    0x2F, 0x49, 0x2E, 0x1B, 0x19, 0x6F, 0x7C, 0x51, 0x35, 0x09, 0x79, 0x4F,
@@ -29,7 +29,7 @@ alignas(64) const uint8_t KASUMI_SBOX_S7[128] = {
    0x44, 0x1D, 0x73, 0x2C, 0x40, 0x6B, 0x6C, 0x18, 0x6E, 0x53, 0x24, 0x4E,
    0x2A, 0x13, 0x0F, 0x29, 0x58, 0x77, 0x3B, 0x03 };
 
-alignas(64) const uint16_t KASUMI_SBOX_S9[512] = {
+BOTAN_ALIGNAS(64) const uint16_t KASUMI_SBOX_S9[512] = {
    0x00A7, 0x00EF, 0x00A1, 0x017B, 0x0187, 0x014E, 0x0009, 0x0152, 0x0026,
    0x00E2, 0x0030, 0x0166, 0x01C4, 0x0181, 0x005A, 0x018D, 0x00B7, 0x00FD,
    0x0093, 0x014B, 0x019F, 0x0154, 0x0033, 0x016A, 0x0132, 0x01F4, 0x0106,
diff --git a/src/lib/block/misty1/misty1.cpp b/src/lib/block/misty1/misty1.cpp
index ba5b06abe..d69be31fd 100644
--- a/src/lib/block/misty1/misty1.cpp
+++ b/src/lib/block/misty1/misty1.cpp
@@ -12,7 +12,7 @@ namespace Botan {
 
 namespace {
 
-alignas(64) static const uint8_t MISTY1_SBOX_S7[128] = {
+BOTAN_ALIGNAS(64) static const uint8_t MISTY1_SBOX_S7[128] = {
    0x1B, 0x32, 0x33, 0x5A, 0x3B, 0x10, 0x17, 0x54, 0x5B, 0x1A, 0x72, 0x73,
    0x6B, 0x2C, 0x66, 0x49, 0x1F, 0x24, 0x13, 0x6C, 0x37, 0x2E, 0x3F, 0x4A,
    0x5D, 0x0F, 0x40, 0x56, 0x25, 0x51, 0x1C, 0x04, 0x0B, 0x46, 0x20, 0x0D,
@@ -25,7 +25,7 @@ alignas(64) static const uint8_t MISTY1_SBOX_S7[128] = {
    0x2D, 0x7A, 0x7F, 0x61, 0x50, 0x22, 0x11, 0x06, 0x47, 0x16, 0x52, 0x4E,
    0x71, 0x3E, 0x69, 0x43, 0x34, 0x5C, 0x58, 0x7D };
 
-alignas(64) static const uint16_t MISTY1_SBOX_S9[512] = {
+BOTAN_ALIGNAS(64) static const uint16_t MISTY1_SBOX_S9[512] = {
    0x01C3, 0x00CB, 0x0153, 0x019F, 0x01E3, 0x00E9, 0x00FB, 0x0035, 0x0181,
    0x00B9, 0x0117, 0x01EB, 0x0133, 0x0009, 0x002D, 0x00D3, 0x00C7, 0x014A,
    0x0037, 0x007E, 0x00EB, 0x0164, 0x0193, 0x01D8, 0x00A3, 0x011E, 0x0055,
diff --git a/src/lib/block/seed/seed.cpp b/src/lib/block/seed/seed.cpp
index e596c70ac..4e9507f45 100644
--- a/src/lib/block/seed/seed.cpp
+++ b/src/lib/block/seed/seed.cpp
@@ -12,7 +12,7 @@ namespace Botan {
 
 namespace {
 
-alignas(64) const uint32_t SEED_S0[256] = {
+BOTAN_ALIGNAS(64) const uint32_t SEED_S0[256] = {
    0x2989A1A8, 0x05858184, 0x16C6D2D4, 0x13C3D3D0, 0x14445054, 0x1D0D111C,
    0x2C8CA0AC, 0x25052124, 0x1D4D515C, 0x03434340, 0x18081018, 0x1E0E121C,
    0x11415150, 0x3CCCF0FC, 0x0ACAC2C8, 0x23436360, 0x28082028, 0x04444044,
@@ -57,7 +57,7 @@ alignas(64) const uint32_t SEED_S0[256] = {
    0x07070304, 0x33033330, 0x28C8E0E8, 0x1B0B1318, 0x05050104, 0x39497178,
    0x10809090, 0x2A4A6268, 0x2A0A2228, 0x1A8A9298 };
 
-alignas(64) const uint32_t SEED_S1[256] = {
+BOTAN_ALIGNAS(64) const uint32_t SEED_S1[256] = {
    0x38380830, 0xE828C8E0, 0x2C2D0D21, 0xA42686A2, 0xCC0FCFC3, 0xDC1ECED2,
    0xB03383B3, 0xB83888B0, 0xAC2F8FA3, 0x60204060, 0x54154551, 0xC407C7C3,
    0x44044440, 0x6C2F4F63, 0x682B4B63, 0x581B4B53, 0xC003C3C3, 0x60224262,
@@ -102,7 +102,7 @@ alignas(64) const uint32_t SEED_S1[256] = {
    0x080A0A02, 0x84078783, 0xD819C9D1, 0x4C0C4C40, 0x80038383, 0x8C0F8F83,
    0xCC0ECEC2, 0x383B0B33, 0x480A4A42, 0xB43787B3 };
 
-alignas(64) const uint32_t SEED_S2[256] = {
+BOTAN_ALIGNAS(64) const uint32_t SEED_S2[256] = {
    0xA1A82989, 0x81840585, 0xD2D416C6, 0xD3D013C3, 0x50541444, 0x111C1D0D,
    0xA0AC2C8C, 0x21242505, 0x515C1D4D, 0x43400343, 0x10181808, 0x121C1E0E,
    0x51501141, 0xF0FC3CCC, 0xC2C80ACA, 0x63602343, 0x20282808, 0x40440444,
@@ -147,7 +147,7 @@ alignas(64) const uint32_t SEED_S2[256] = {
    0x03040707, 0x33303303, 0xE0E828C8, 0x13181B0B, 0x01040505, 0x71783949,
    0x90901080, 0x62682A4A, 0x22282A0A, 0x92981A8A };
 
-alignas(64) const uint32_t SEED_S3[256] = {
+BOTAN_ALIGNAS(64) const uint32_t SEED_S3[256] = {
    0x08303838, 0xC8E0E828, 0x0D212C2D, 0x86A2A426, 0xCFC3CC0F, 0xCED2DC1E,
    0x83B3B033, 0x88B0B838, 0x8FA3AC2F, 0x40606020, 0x45515415, 0xC7C3C407,
    0x44404404, 0x4F636C2F, 0x4B63682B, 0x4B53581B, 0xC3C3C003, 0x42626022,
diff --git a/src/lib/block/sm4/sm4.cpp b/src/lib/block/sm4/sm4.cpp
index 8198330e6..3f8269dc3 100644
--- a/src/lib/block/sm4/sm4.cpp
+++ b/src/lib/block/sm4/sm4.cpp
@@ -15,7 +15,7 @@ namespace Botan {
 
 namespace {
 
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint8_t SM4_SBOX[256] = {
 0xD6, 0x90, 0xE9, 0xFE, 0xCC, 0xE1, 0x3D, 0xB7, 0x16, 0xB6, 0x14, 0xC2, 0x28, 0xFB, 0x2C, 0x05,
 0x2B, 0x67, 0x9A, 0x76, 0x2A, 0xBE, 0x04, 0xC3, 0xAA, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99,
@@ -38,7 +38,7 @@ const uint8_t SM4_SBOX[256] = {
 /*
 * SM4_SBOX_T[j] == L(SM4_SBOX[j]).
 */
-alignas(64)
+BOTAN_ALIGNAS(64)
 const uint32_t SM4_SBOX_T[256] = {
    0x8ED55B5B, 0xD0924242, 0x4DEAA7A7, 0x06FDFBFB, 0xFCCF3333, 0x65E28787,
    0xC93DF4F4, 0x6BB5DEDE, 0x4E165858, 0x6EB4DADA, 0x44145050, 0xCAC10B0B,
diff --git a/src/lib/block/twofish/twofish_tab.cpp b/src/lib/block/twofish/twofish_tab.cpp
index acdb35560..303f7317a 100644
--- a/src/lib/block/twofish/twofish_tab.cpp
+++ b/src/lib/block/twofish/twofish_tab.cpp
@@ -9,7 +9,7 @@
 
 namespace Botan {
 
-alignas(64) const uint8_t Twofish::Q0[256] = {
+BOTAN_ALIGNAS(64) const uint8_t Twofish::Q0[256] = {
    0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78,
    0xE4, 0xDD, 0xD1, 0x38, 0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C,
    0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 0xF2, 0xD0, 0x8B, 0x30,
@@ -33,7 +33,7 @@ alignas(64) const uint8_t Twofish::Q0[256] = {
    0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 0x6F, 0x9D, 0x36, 0x42,
    0x4A, 0x5E, 0xC1, 0xE0 };
 
-alignas(64) const uint8_t Twofish::Q1[256] = {
+BOTAN_ALIGNAS(64) const uint8_t Twofish::Q1[256] = {
    0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 0x4A, 0xD3, 0xE6, 0x6B,
    0x45, 0x7D, 0xE8, 0x4B, 0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1,
    0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 0x5E, 0xBA, 0xAE, 0x5B,
@@ -57,12 +57,12 @@ alignas(64) const uint8_t Twofish::Q1[256] = {
    0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 0x16, 0x25, 0x86, 0x56,
    0x55, 0x09, 0xBE, 0x91 };
 
-alignas(64) const uint8_t Twofish::RS[32] = {
+BOTAN_ALIGNAS(64) const uint8_t Twofish::RS[32] = {
    0x01, 0xA4, 0x02, 0xA4, 0xA4, 0x56, 0xA1, 0x55, 0x55, 0x82, 0xFC, 0x87,
    0x87, 0xF3, 0xC1, 0x5A, 0x5A, 0x1E, 0x47, 0x58, 0x58, 0xC6, 0xAE, 0xDB,
    0xDB, 0x68, 0x3D, 0x9E, 0x9E, 0xE5, 0x19, 0x03 };
 
-alignas(64) const uint8_t Twofish::EXP_TO_POLY[255] = {
+BOTAN_ALIGNAS(64) const uint8_t Twofish::EXP_TO_POLY[255] = {
    0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x4D, 0x9A, 0x79, 0xF2,
    0xA9, 0x1F, 0x3E, 0x7C, 0xF8, 0xBD, 0x37, 0x6E, 0xDC, 0xF5, 0xA7, 0x03,
    0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xCD, 0xD7, 0xE3, 0x8B, 0x5B, 0xB6,
@@ -86,7 +86,7 @@ alignas(64) const uint8_t Twofish::EXP_TO_POLY[255] = {
    0x3B, 0x76, 0xEC, 0x95, 0x67, 0xCE, 0xD1, 0xEF, 0x93, 0x6B, 0xD6, 0xE1,
    0x8F, 0x53, 0xA6 };
 
-alignas(64) const uint8_t Twofish::POLY_TO_EXP[255] = {
+BOTAN_ALIGNAS(64) const uint8_t Twofish::POLY_TO_EXP[255] = {
    0x00, 0x01, 0x17, 0x02, 0x2E, 0x18, 0x53, 0x03, 0x6A, 0x2F, 0x93, 0x19,
    0x34, 0x54, 0x45, 0x04, 0x5C, 0x6B, 0xB6, 0x30, 0xA6, 0x94, 0x4B, 0x1A,
    0x8C, 0x35, 0x81, 0x55, 0xAA, 0x46, 0x0D, 0x05, 0x24, 0x5D, 0x87, 0x6C,
@@ -110,7 +110,7 @@ alignas(64) const uint8_t Twofish::POLY_TO_EXP[255] = {
    0xB4, 0x0B, 0x7F, 0x51, 0x15, 0x43, 0x91, 0x10, 0x71, 0xBB, 0xEE, 0xBF,
    0x85, 0xC8, 0xA1 };
 
-alignas(64) const uint32_t Twofish::MDS0[256] = {
+BOTAN_ALIGNAS(64) const uint32_t Twofish::MDS0[256] = {
    0xBCBC3275, 0xECEC21F3, 0x202043C6, 0xB3B3C9F4, 0xDADA03DB, 0x02028B7B,
    0xE2E22BFB, 0x9E9EFAC8, 0xC9C9EC4A, 0xD4D409D3, 0x18186BE6, 0x1E1E9F6B,
    0x98980E45, 0xB2B2387D, 0xA6A6D2E8, 0x2626B74B, 0x3C3C57D6, 0x93938A32,
@@ -155,7 +155,7 @@ alignas(64) const uint32_t Twofish::MDS0[256] = {
    0x04047FF6, 0x272746C2, 0xACACA716, 0xD0D07625, 0x50501386, 0xDCDCF756,
    0x84841A55, 0xE1E15109, 0x7A7A25BE, 0x1313EF91 };
 
-alignas(64) const uint32_t Twofish::MDS1[256] = {
+BOTAN_ALIGNAS(64) const uint32_t Twofish::MDS1[256] = {
    0xA9D93939, 0x67901717, 0xB3719C9C, 0xE8D2A6A6, 0x04050707, 0xFD985252,
    0xA3658080, 0x76DFE4E4, 0x9A084545, 0x92024B4B, 0x80A0E0E0, 0x78665A5A,
    0xE4DDAFAF, 0xDDB06A6A, 0xD1BF6363, 0x38362A2A, 0x0D54E6E6, 0xC6432020,
@@ -200,7 +200,7 @@ alignas(64) const uint32_t Twofish::MDS1[256] = {
    0x0FE25151, 0x00000000, 0x6F9A1919, 0x9DE01A1A, 0x368F9494, 0x42E6C7C7,
    0x4AECC9C9, 0x5EFDD2D2, 0xC1AB7F7F, 0xE0D8A8A8 };
 
-alignas(64) const uint32_t Twofish::MDS2[256] = {
+BOTAN_ALIGNAS(64) const uint32_t Twofish::MDS2[256] = {
    0xBC75BC32, 0xECF3EC21, 0x20C62043, 0xB3F4B3C9, 0xDADBDA03, 0x027B028B,
    0xE2FBE22B, 0x9EC89EFA, 0xC94AC9EC, 0xD4D3D409, 0x18E6186B, 0x1E6B1E9F,
    0x9845980E, 0xB27DB238, 0xA6E8A6D2, 0x264B26B7, 0x3CD63C57, 0x9332938A,
@@ -245,7 +245,7 @@ alignas(64) const uint32_t Twofish::MDS2[256] = {
    0x04F6047F, 0x27C22746, 0xAC16ACA7, 0xD025D076, 0x50865013, 0xDC56DCF7,
    0x8455841A, 0xE109E151, 0x7ABE7A25, 0x139113EF };
 
-alignas(64) const uint32_t Twofish::MDS3[256] = {
+BOTAN_ALIGNAS(64) const uint32_t Twofish::MDS3[256] = {
    0xD939A9D9, 0x90176790, 0x719CB371, 0xD2A6E8D2, 0x05070405, 0x9852FD98,
    0x6580A365, 0xDFE476DF, 0x08459A08, 0x024B9202, 0xA0E080A0, 0x665A7866,
    0xDDAFE4DD, 0xB06ADDB0, 0xBF63D1BF, 0x362A3836, 0x54E60D54, 0x4320C643,
diff --git a/src/lib/compression/compression.h b/src/lib/compression/compression.h
index 217fae623..0e62468e8 100644
--- a/src/lib/compression/compression.h
+++ b/src/lib/compression/compression.h
@@ -72,7 +72,7 @@ class BOTAN_PUBLIC_API(2,0) Compression_Algorithm
       */
       virtual void clear() = 0;
 
-      virtual ~Compression_Algorithm() = default;
+      virtual ~Compression_Algorithm() {}
    };
 
 /*
@@ -128,7 +128,7 @@ class BOTAN_PUBLIC_API(2,0) Decompression_Algorithm
       */
       virtual void clear() = 0;
 
-      virtual ~Decompression_Algorithm() = default;
+      virtual ~Decompression_Algorithm() {}
    };
 
 BOTAN_PUBLIC_API(2,0) Compression_Algorithm* make_compressor(const std::string& type);
@@ -170,7 +170,7 @@ class BOTAN_PUBLIC_API(2,9) Compression_Error : public Exception
 class Compression_Stream
    {
    public:
-      virtual ~Compression_Stream() = default;
+      virtual ~Compression_Stream() {}
 
       virtual void next_in(uint8_t* b, size_t len) = 0;
 
diff --git a/src/lib/entropy/entropy_src.h b/src/lib/entropy/entropy_src.h
index 56e5bd53e..d9937b988 100644
--- a/src/lib/entropy/entropy_src.h
+++ b/src/lib/entropy/entropy_src.h
@@ -50,7 +50,7 @@ class BOTAN_PUBLIC_API(2,0) Entropy_Source
       Entropy_Source(Entropy_Source&& other) = delete;
       Entropy_Source& operator=(const Entropy_Source& other) = delete;
 
-      virtual ~Entropy_Source() = default;
+      virtual ~Entropy_Source() {}
    };
 
 class BOTAN_PUBLIC_API(2,0) Entropy_Sources final
diff --git a/src/lib/entropy/proc_walk/proc_walk.h b/src/lib/entropy/proc_walk/proc_walk.h
index 4c5013d29..665be2f17 100644
--- a/src/lib/entropy/proc_walk/proc_walk.h
+++ b/src/lib/entropy/proc_walk/proc_walk.h
@@ -17,7 +17,7 @@ class File_Descriptor_Source
    {
    public:
       virtual int next_fd() = 0;
-      virtual ~File_Descriptor_Source() = default;
+      virtual ~File_Descriptor_Source() {}
    };
 
 /**
diff --git a/src/lib/filters/data_snk.h b/src/lib/filters/data_snk.h
index 49484b1c1..1ef872095 100644
--- a/src/lib/filters/data_snk.h
+++ b/src/lib/filters/data_snk.h
@@ -23,7 +23,7 @@ class BOTAN_PUBLIC_API(2,0) DataSink : public Filter
    public:
       bool attachable() override { return false; }
       DataSink() = default;
-      virtual ~DataSink() = default;
+      virtual ~DataSink() {}
 
       DataSink& operator=(const DataSink&) = delete;
       DataSink(const DataSink&) = delete;
diff --git a/src/lib/filters/filter.h b/src/lib/filters/filter.h
index 94b9c6ccd..9d78b47a4 100644
--- a/src/lib/filters/filter.h
+++ b/src/lib/filters/filter.h
@@ -51,7 +51,7 @@ class BOTAN_PUBLIC_API(2,0) Filter
       */
       virtual bool attachable() { return true; }
 
-      virtual ~Filter() = default;
+      virtual ~Filter() {}
    protected:
       /**
       * @param in some input for the filter
diff --git a/src/lib/filters/filters.h b/src/lib/filters/filters.h
index c19e1a749..3fb0b9bad 100644
--- a/src/lib/filters/filters.h
+++ b/src/lib/filters/filters.h
@@ -70,7 +70,7 @@ class BOTAN_PUBLIC_API(2,0) Buffered_Filter
       */
       Buffered_Filter(size_t block_size, size_t final_minimum);
 
-      virtual ~Buffered_Filter() = default;
+      virtual ~Buffered_Filter() {}
    protected:
       /**
       * The block processor, implemented by subclasses
diff --git a/src/lib/hash/checksum/crc24/crc24.cpp b/src/lib/hash/checksum/crc24/crc24.cpp
index cfec0471c..15c54b3cc 100644
--- a/src/lib/hash/checksum/crc24/crc24.cpp
+++ b/src/lib/hash/checksum/crc24/crc24.cpp
@@ -14,7 +14,7 @@ namespace Botan {
 
 namespace {
 
-alignas(64) const uint32_t CRC24_T0[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CRC24_T0[256] = {
    0x00000000, 0x00FB4C86, 0x000DD58A, 0x00F6990C, 0x00E1E693, 0x001AAA15, 0x00EC3319,
    0x00177F9F, 0x003981A1, 0x00C2CD27, 0x0034542B, 0x00CF18AD, 0x00D86732, 0x00232BB4,
    0x00D5B2B8, 0x002EFE3E, 0x00894EC5, 0x00720243, 0x00849B4F, 0x007FD7C9, 0x0068A856,
@@ -53,7 +53,7 @@ alignas(64) const uint32_t CRC24_T0[256] = {
    0x000CD1F6, 0x00FA48FA, 0x0001047C, 0x002FFA42, 0x00D4B6C4, 0x00222FC8, 0x00D9634E,
    0x00CE1CD1, 0x00355057, 0x00C3C95B, 0x003885DD };
 
-alignas(64) const uint32_t CRC24_T1[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CRC24_T1[256] = {
    0x00000000, 0x00488F66, 0x00901ECD, 0x00D891AB, 0x00DB711C, 0x0093FE7A, 0x004B6FD1,
    0x0003E0B7, 0x00B6E338, 0x00FE6C5E, 0x0026FDF5, 0x006E7293, 0x006D9224, 0x00251D42,
    0x00FD8CE9, 0x00B5038F, 0x006CC771, 0x00244817, 0x00FCD9BC, 0x00B456DA, 0x00B7B66D,
@@ -92,7 +92,7 @@ alignas(64) const uint32_t CRC24_T1[256] = {
    0x00FA442B, 0x0022D580, 0x006A5AE6, 0x00DF5969, 0x0097D60F, 0x004F47A4, 0x0007C8C2,
    0x00042875, 0x004CA713, 0x009436B8, 0x00DCB9DE };
 
-alignas(64) const uint32_t CRC24_T2[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CRC24_T2[256] = {
    0x00000000, 0x00D70983, 0x00555F80, 0x00825603, 0x0051F286, 0x0086FB05, 0x0004AD06,
    0x00D3A485, 0x0059A88B, 0x008EA108, 0x000CF70B, 0x00DBFE88, 0x00085A0D, 0x00DF538E,
    0x005D058D, 0x008A0C0E, 0x00491C91, 0x009E1512, 0x001C4311, 0x00CB4A92, 0x0018EE17,
@@ -131,7 +131,7 @@ alignas(64) const uint32_t CRC24_T2[256] = {
    0x002633E5, 0x00A465E6, 0x00736C65, 0x00F9606B, 0x002E69E8, 0x00AC3FEB, 0x007B3668,
    0x00A892ED, 0x007F9B6E, 0x00FDCD6D, 0x002AC4EE };
 
-alignas(64) const uint32_t CRC24_T3[256] = {
+BOTAN_ALIGNAS(64) const uint32_t CRC24_T3[256] = {
    0x00000000, 0x00520936, 0x00A4126C, 0x00F61B5A, 0x004825D8, 0x001A2CEE, 0x00EC37B4,
    0x00BE3E82, 0x006B0636, 0x00390F00, 0x00CF145A, 0x009D1D6C, 0x002323EE, 0x00712AD8,
    0x00873182, 0x00D538B4, 0x00D60C6C, 0x0084055A, 0x00721E00, 0x00201736, 0x009E29B4,
diff --git a/src/lib/hash/hash.h b/src/lib/hash/hash.h
index 8c6440e65..d6dd05907 100644
--- a/src/lib/hash/hash.h
+++ b/src/lib/hash/hash.h
@@ -57,7 +57,7 @@ class BOTAN_PUBLIC_API(2,0) HashFunction : public Buffered_Computation
       */
       virtual std::string provider() const { return "base"; }
 
-      virtual ~HashFunction() = default;
+      virtual ~HashFunction() {}
 
       /**
       * Reset the state.
diff --git a/src/lib/hash/whirlpool/whrl_tab.cpp b/src/lib/hash/whirlpool/whrl_tab.cpp
index e4be36247..bd2447c07 100644
--- a/src/lib/hash/whirlpool/whrl_tab.cpp
+++ b/src/lib/hash/whirlpool/whrl_tab.cpp
@@ -9,7 +9,7 @@
 
 namespace Botan {
 
-alignas(64) const uint64_t Whirlpool::C0[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C0[256] = {
 0x18186018C07830D8, 0x23238C2305AF4626, 0xC6C63FC67EF991B8, 0xE8E887E8136FCDFB,
 0x878726874CA113CB, 0xB8B8DAB8A9626D11, 0x0101040108050209, 0x4F4F214F426E9E0D,
 0x3636D836ADEE6C9B, 0xA6A6A2A6590451FF, 0xD2D26FD2DEBDB90C, 0xF5F5F3F5FB06F70E,
@@ -75,7 +75,7 @@ alignas(64) const uint64_t Whirlpool::C0[256] = {
 0xCCCC17CC2EDB85E2, 0x424215422A578468, 0x98985A98B4C22D2C, 0xA4A4AAA4490E55ED,
 0x2828A0285D885075, 0x5C5C6D5CDA31B886, 0xF8F8C7F8933FED6B, 0x8686228644A411C2 };
 
-alignas(64) const uint64_t Whirlpool::C1[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C1[256] = {
 0xD818186018C07830, 0x2623238C2305AF46, 0xB8C6C63FC67EF991, 0xFBE8E887E8136FCD,
 0xCB878726874CA113, 0x11B8B8DAB8A9626D, 0x0901010401080502, 0x0D4F4F214F426E9E,
 0x9B3636D836ADEE6C, 0xFFA6A6A2A6590451, 0x0CD2D26FD2DEBDB9, 0x0EF5F5F3F5FB06F7,
@@ -141,7 +141,7 @@ alignas(64) const uint64_t Whirlpool::C1[256] = {
 0xE2CCCC17CC2EDB85, 0x68424215422A5784, 0x2C98985A98B4C22D, 0xEDA4A4AAA4490E55,
 0x752828A0285D8850, 0x865C5C6D5CDA31B8, 0x6BF8F8C7F8933FED, 0xC28686228644A411 };
 
-alignas(64) const uint64_t Whirlpool::C2[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C2[256] = {
 0x30D818186018C078, 0x462623238C2305AF, 0x91B8C6C63FC67EF9, 0xCDFBE8E887E8136F,
 0x13CB878726874CA1, 0x6D11B8B8DAB8A962, 0x0209010104010805, 0x9E0D4F4F214F426E,
 0x6C9B3636D836ADEE, 0x51FFA6A6A2A65904, 0xB90CD2D26FD2DEBD, 0xF70EF5F5F3F5FB06,
@@ -207,7 +207,7 @@ alignas(64) const uint64_t Whirlpool::C2[256] = {
 0x85E2CCCC17CC2EDB, 0x8468424215422A57, 0x2D2C98985A98B4C2, 0x55EDA4A4AAA4490E,
 0x50752828A0285D88, 0xB8865C5C6D5CDA31, 0xED6BF8F8C7F8933F, 0x11C28686228644A4 };
 
-alignas(64) const uint64_t Whirlpool::C3[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C3[256] = {
 0x7830D818186018C0, 0xAF462623238C2305, 0xF991B8C6C63FC67E, 0x6FCDFBE8E887E813,
 0xA113CB878726874C, 0x626D11B8B8DAB8A9, 0x0502090101040108, 0x6E9E0D4F4F214F42,
 0xEE6C9B3636D836AD, 0x0451FFA6A6A2A659, 0xBDB90CD2D26FD2DE, 0x06F70EF5F5F3F5FB,
@@ -273,7 +273,7 @@ alignas(64) const uint64_t Whirlpool::C3[256] = {
 0xDB85E2CCCC17CC2E, 0x578468424215422A, 0xC22D2C98985A98B4, 0x0E55EDA4A4AAA449,
 0x8850752828A0285D, 0x31B8865C5C6D5CDA, 0x3FED6BF8F8C7F893, 0xA411C28686228644 };
 
-alignas(64) const uint64_t Whirlpool::C4[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C4[256] = {
 0xC07830D818186018, 0x05AF462623238C23, 0x7EF991B8C6C63FC6, 0x136FCDFBE8E887E8,
 0x4CA113CB87872687, 0xA9626D11B8B8DAB8, 0x0805020901010401, 0x426E9E0D4F4F214F,
 0xADEE6C9B3636D836, 0x590451FFA6A6A2A6, 0xDEBDB90CD2D26FD2, 0xFB06F70EF5F5F3F5,
@@ -339,7 +339,7 @@ alignas(64) const uint64_t Whirlpool::C4[256] = {
 0x2EDB85E2CCCC17CC, 0x2A57846842421542, 0xB4C22D2C98985A98, 0x490E55EDA4A4AAA4,
 0x5D8850752828A028, 0xDA31B8865C5C6D5C, 0x933FED6BF8F8C7F8, 0x44A411C286862286 };
 
-alignas(64) const uint64_t Whirlpool::C5[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C5[256] = {
 0x18C07830D8181860, 0x2305AF462623238C, 0xC67EF991B8C6C63F, 0xE8136FCDFBE8E887,
 0x874CA113CB878726, 0xB8A9626D11B8B8DA, 0x0108050209010104, 0x4F426E9E0D4F4F21,
 0x36ADEE6C9B3636D8, 0xA6590451FFA6A6A2, 0xD2DEBDB90CD2D26F, 0xF5FB06F70EF5F5F3,
@@ -405,7 +405,7 @@ alignas(64) const uint64_t Whirlpool::C5[256] = {
 0xCC2EDB85E2CCCC17, 0x422A578468424215, 0x98B4C22D2C98985A, 0xA4490E55EDA4A4AA,
 0x285D8850752828A0, 0x5CDA31B8865C5C6D, 0xF8933FED6BF8F8C7, 0x8644A411C2868622 };
 
-alignas(64) const uint64_t Whirlpool::C6[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C6[256] = {
 0x6018C07830D81818, 0x8C2305AF46262323, 0x3FC67EF991B8C6C6, 0x87E8136FCDFBE8E8,
 0x26874CA113CB8787, 0xDAB8A9626D11B8B8, 0x0401080502090101, 0x214F426E9E0D4F4F,
 0xD836ADEE6C9B3636, 0xA2A6590451FFA6A6, 0x6FD2DEBDB90CD2D2, 0xF3F5FB06F70EF5F5,
@@ -471,7 +471,7 @@ alignas(64) const uint64_t Whirlpool::C6[256] = {
 0x17CC2EDB85E2CCCC, 0x15422A5784684242, 0x5A98B4C22D2C9898, 0xAAA4490E55EDA4A4,
 0xA0285D8850752828, 0x6D5CDA31B8865C5C, 0xC7F8933FED6BF8F8, 0x228644A411C28686 };
 
-alignas(64) const uint64_t Whirlpool::C7[256] = {
+BOTAN_ALIGNAS(64) const uint64_t Whirlpool::C7[256] = {
 0x186018C07830D818, 0x238C2305AF462623, 0xC63FC67EF991B8C6, 0xE887E8136FCDFBE8,
 0x8726874CA113CB87, 0xB8DAB8A9626D11B8, 0x0104010805020901, 0x4F214F426E9E0D4F,
 0x36D836ADEE6C9B36, 0xA6A2A6590451FFA6, 0xD26FD2DEBDB90CD2, 0xF5F3F5FB06F70EF5,
diff --git a/src/lib/kdf/kdf.h b/src/lib/kdf/kdf.h
index dd4cfedf6..cd9c2b2ee 100644
--- a/src/lib/kdf/kdf.h
+++ b/src/lib/kdf/kdf.h
@@ -20,7 +20,7 @@ namespace Botan {
 class BOTAN_PUBLIC_API(2,0) KDF
    {
    public:
-      virtual ~KDF() = default;
+      virtual ~KDF() {}
 
       /**
       * Create an instance based on a name
diff --git a/src/lib/mac/mac.h b/src/lib/mac/mac.h
index de30b7dbb..197bfe011 100644
--- a/src/lib/mac/mac.h
+++ b/src/lib/mac/mac.h
@@ -49,7 +49,7 @@ class BOTAN_PUBLIC_API(2,0) MessageAuthenticationCode : public Buffered_Computat
       */
       static std::vector<std::string> providers(const std::string& algo_spec);
 
-      virtual ~MessageAuthenticationCode() = default;
+      virtual ~MessageAuthenticationCode() {}
 
       /**
       * Prepare for processing a message under the specified nonce
diff --git a/src/lib/math/numbertheory/pow_mod.cpp b/src/lib/math/numbertheory/pow_mod.cpp
index 7b38fad1d..beba1b4d3 100644
--- a/src/lib/math/numbertheory/pow_mod.cpp
+++ b/src/lib/math/numbertheory/pow_mod.cpp
@@ -27,7 +27,7 @@ class Modular_Exponentiator
       Modular_Exponentiator() = default;
       Modular_Exponentiator(const Modular_Exponentiator&) = default;
       Modular_Exponentiator & operator=(const Modular_Exponentiator&) = default;
-      virtual ~Modular_Exponentiator() = default;
+      virtual ~Modular_Exponentiator() {}
    };
 
 namespace {
diff --git a/src/lib/misc/roughtime/roughtime.cpp b/src/lib/misc/roughtime/roughtime.cpp
index 384d40626..9519c1eae 100644
--- a/src/lib/misc/roughtime/roughtime.cpp
+++ b/src/lib/misc/roughtime/roughtime.cpp
@@ -79,7 +79,9 @@ std::map<std::string, std::vector<uint8_t>> unpack_roughtime_packet(T bytes)
          { throw Roughtime::Roughtime_Error("Tag offset must be more than previous tag offset"); }
       const char* label_ptr = cast_uint8_ptr_to_char(buf) + (num_tags+i)*4;
       const char label[] = {label_ptr[0], label_ptr[1], label_ptr[2], label_ptr[3], 0};
-      auto ret = tags.emplace(label, std::vector<uint8_t>(buf+start, buf+end));
+
+      std::vector<uint8_t> val(buf + start, buf + end);
+      auto ret = tags.insert(std::make_pair(std::string(label), val));
       if(!ret.second)
          { throw Roughtime::Roughtime_Error(std::string("Map has duplicated tag: ") + label); }
       start = static_cast<uint32_t>(end);
diff --git a/src/lib/misc/zfec/zfec.cpp b/src/lib/misc/zfec/zfec.cpp
index 5eba25c8a..b648ca4aa 100644
--- a/src/lib/misc/zfec/zfec.cpp
+++ b/src/lib/misc/zfec/zfec.cpp
@@ -29,7 +29,7 @@ namespace {
 *     polynomial form -> index form    gf_log[ j = \alpha^i ] = i
 * \alpha=x is the primitive element of GF(2^m)
 */
-alignas(256) const uint8_t GF_EXP[255] = {
+BOTAN_ALIGNAS(256) const uint8_t GF_EXP[255] = {
    0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1D, 0x3A, 0x74,
    0xE8, 0xCD, 0x87, 0x13, 0x26, 0x4C, 0x98, 0x2D, 0x5A, 0xB4, 0x75,
    0xEA, 0xC9, 0x8F, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x9D,
@@ -56,7 +56,7 @@ alignas(256) const uint8_t GF_EXP[255] = {
    0x47, 0x8E,
 };
 
-alignas(256) const uint8_t GF_LOG[256] = {
+BOTAN_ALIGNAS(256) const uint8_t GF_LOG[256] = {
    0xFF, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1A, 0xC6, 0x03, 0xDF, 0x33,
    0xEE, 0x1B, 0x68, 0xC7, 0x4B, 0x04, 0x64, 0xE0, 0x0E, 0x34, 0x8D,
    0xEF, 0x81, 0x1C, 0xC1, 0x69, 0xF8, 0xC8, 0x08, 0x4C, 0x71, 0x05,
@@ -82,7 +82,7 @@ alignas(256) const uint8_t GF_LOG[256] = {
    0xD5, 0xE9, 0xE6, 0xE7, 0xAD, 0xE8, 0x74, 0xD6, 0xF4, 0xEA, 0xA8,
    0x50, 0x58, 0xAF };
 
-alignas(256) const uint8_t GF_INVERSE[256] = {
+BOTAN_ALIGNAS(256) const uint8_t GF_INVERSE[256] = {
    0x00, 0x01, 0x8E, 0xF4, 0x47, 0xA7, 0x7A, 0xBA, 0xAD, 0x9D, 0xDD,
    0x98, 0x3D, 0xAA, 0x5D, 0x96, 0xD8, 0x72, 0xC0, 0x58, 0xE0, 0x3E,
    0x4C, 0x66, 0x90, 0xDE, 0x55, 0x80, 0xA0, 0x83, 0x4B, 0x2A, 0x6C,
diff --git a/src/lib/misc/zfec/zfec_vperm/zfec_vperm.cpp b/src/lib/misc/zfec/zfec_vperm/zfec_vperm.cpp
index 72c728da7..8a91b93bf 100644
--- a/src/lib/misc/zfec/zfec_vperm/zfec_vperm.cpp
+++ b/src/lib/misc/zfec/zfec_vperm/zfec_vperm.cpp
@@ -23,7 +23,7 @@ namespace {
  * b -> y(bx^4)
  * and the final output is the sum of these two outputs.
  */
-alignas(256) const uint8_t GFTBL[256*32] = {
+BOTAN_ALIGNAS(256) const uint8_t GFTBL[256*32] = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
diff --git a/src/lib/modes/aead/aead.h b/src/lib/modes/aead/aead.h
index 442eb8ed7..1aa2642ac 100644
--- a/src/lib/modes/aead/aead.h
+++ b/src/lib/modes/aead/aead.h
@@ -129,7 +129,7 @@ class BOTAN_PUBLIC_API(2,0) AEAD_Mode : public Cipher_Mode
       */
       size_t default_nonce_length() const override { return 12; }
 
-      virtual ~AEAD_Mode() = default;
+      virtual ~AEAD_Mode() {}
    };
 
 /**
diff --git a/src/lib/modes/mode_pad/mode_pad.h b/src/lib/modes/mode_pad/mode_pad.h
index b0e4a3cfa..1cee2c683 100644
--- a/src/lib/modes/mode_pad/mode_pad.h
+++ b/src/lib/modes/mode_pad/mode_pad.h
@@ -60,7 +60,7 @@ class BOTAN_PUBLIC_API(2,0) BlockCipherModePaddingMethod
       /**
       * virtual destructor
       */
-      virtual ~BlockCipherModePaddingMethod() = default;
+      virtual ~BlockCipherModePaddingMethod() {}
    };
 
 /**
diff --git a/src/lib/pbkdf/pbkdf.h b/src/lib/pbkdf/pbkdf.h
index e7f0a84ee..106afe291 100644
--- a/src/lib/pbkdf/pbkdf.h
+++ b/src/lib/pbkdf/pbkdf.h
@@ -58,7 +58,7 @@ class BOTAN_PUBLIC_API(2,0) PBKDF
       */
       virtual std::string name() const = 0;
 
-      virtual ~PBKDF() = default;
+      virtual ~PBKDF() {}
 
       /**
       * Derive a key from a passphrase for a number of iterations
diff --git a/src/lib/pbkdf/pwdhash.h b/src/lib/pbkdf/pwdhash.h
index ba64a73fd..8b387b0e2 100644
--- a/src/lib/pbkdf/pwdhash.h
+++ b/src/lib/pbkdf/pwdhash.h
@@ -24,7 +24,7 @@ namespace Botan {
 class BOTAN_PUBLIC_API(2,8) PasswordHash
    {
    public:
-      virtual ~PasswordHash() = default;
+      virtual ~PasswordHash() {}
 
       virtual std::string to_string() const = 0;
 
@@ -103,7 +103,7 @@ class BOTAN_PUBLIC_API(2,8) PasswordHashFamily
       */
       static std::vector<std::string> providers(const std::string& algo_spec);
 
-      virtual ~PasswordHashFamily() = default;
+      virtual ~PasswordHashFamily() {}
 
       /**
       * @return name of this PasswordHash
diff --git a/src/lib/pk_pad/eme.h b/src/lib/pk_pad/eme.h
index 38cce4b09..9836d8380 100644
--- a/src/lib/pk_pad/eme.h
+++ b/src/lib/pk_pad/eme.h
@@ -23,7 +23,7 @@ class RandomNumberGenerator;
 class BOTAN_PUBLIC_API(2,0) EME
    {
    public:
-      virtual ~EME() = default;
+      virtual ~EME() {}
 
       /**
       * Return the maximum input size in bytes we can support
diff --git a/src/lib/pk_pad/emsa.h b/src/lib/pk_pad/emsa.h
index 7178eae23..26352b7ef 100644
--- a/src/lib/pk_pad/emsa.h
+++ b/src/lib/pk_pad/emsa.h
@@ -27,7 +27,7 @@ class RandomNumberGenerator;
 class BOTAN_PUBLIC_API(2,0) EMSA
    {
    public:
-      virtual ~EMSA() = default;
+      virtual ~EMSA() {}
 
       /**
       * Add more data to the signature computation
diff --git a/src/lib/prov/pkcs11/p11_mechanism.cpp b/src/lib/prov/pkcs11/p11_mechanism.cpp
index e06dcfc1f..45b265fd4 100644
--- a/src/lib/prov/pkcs11/p11_mechanism.cpp
+++ b/src/lib/prov/pkcs11/p11_mechanism.cpp
@@ -38,7 +38,7 @@ struct MechanismData
 
    MechanismData(MechanismData const&) = default;
    MechanismData& operator=(MechanismData const&) = default;
-   virtual ~MechanismData() = default;
+   virtual ~MechanismData() {}
 
    // the mechanism to perform
    MechanismType type;
diff --git a/src/lib/prov/pkcs11/p11_object.h b/src/lib/prov/pkcs11/p11_object.h
index a0da1b5ca..09126e2b8 100644
--- a/src/lib/prov/pkcs11/p11_object.h
+++ b/src/lib/prov/pkcs11/p11_object.h
@@ -33,7 +33,7 @@ class BOTAN_PUBLIC_API(2,0) AttributeContainer
       /// @param object_class the class type of this container
       AttributeContainer(ObjectClass object_class);
 
-      virtual ~AttributeContainer() = default;
+      virtual ~AttributeContainer() {}
 
       AttributeContainer(AttributeContainer&& other) = default;
       AttributeContainer& operator=(AttributeContainer&& other) = default;
@@ -650,7 +650,7 @@ class BOTAN_PUBLIC_API(2,0) Object
 
       Object(const Object&) = default;
       Object& operator=(const Object&) = delete;
-      virtual ~Object() = default;
+      virtual ~Object() {}
 
       /// Searches for all objects of the given type that match `search_template`
       template<typename T>
diff --git a/src/lib/prov/pkcs11/p11_rsa.h b/src/lib/prov/pkcs11/p11_rsa.h
index 41d9bc134..2a1021716 100644
--- a/src/lib/prov/pkcs11/p11_rsa.h
+++ b/src/lib/prov/pkcs11/p11_rsa.h
@@ -34,7 +34,7 @@ class BOTAN_PUBLIC_API(2,0) RSA_PublicKeyGenerationProperties final : public Pub
          add_binary(AttributeType::PublicExponent, BigInt::encode(pub_exponent));
          }
 
-      virtual ~RSA_PublicKeyGenerationProperties() = default;
+      virtual ~RSA_PublicKeyGenerationProperties() {}
    };
 
 /// Properties for importing a PKCS#11 RSA public key
@@ -57,7 +57,7 @@ class BOTAN_PUBLIC_API(2,0) RSA_PublicKeyImportProperties final : public PublicK
          return m_pub_exponent;
          }
 
-      virtual ~RSA_PublicKeyImportProperties() = default;
+      virtual ~RSA_PublicKeyImportProperties() {}
    private:
       const BigInt m_modulus;
       const BigInt m_pub_exponent;
@@ -151,7 +151,7 @@ class BOTAN_PUBLIC_API(2,0) RSA_PrivateKeyImportProperties final : public Privat
          return m_priv_exponent;
          }
 
-      virtual ~RSA_PrivateKeyImportProperties() = default;
+      virtual ~RSA_PrivateKeyImportProperties() {}
 
    private:
       const BigInt m_modulus;
@@ -166,7 +166,7 @@ class BOTAN_PUBLIC_API(2,0) RSA_PrivateKeyGenerationProperties final : public Pr
          : PrivateKeyProperties(KeyType::Rsa)
          {}
 
-      virtual ~RSA_PrivateKeyGenerationProperties() = default;
+      virtual ~RSA_PrivateKeyGenerationProperties() {}
    };
 
 /// Represents a PKCS#11 RSA private key
diff --git a/src/lib/psk_db/psk_db.h b/src/lib/psk_db/psk_db.h
index 06358935c..232795927 100644
--- a/src/lib/psk_db/psk_db.h
+++ b/src/lib/psk_db/psk_db.h
@@ -75,7 +75,7 @@ class BOTAN_PUBLIC_API(2,4) PSK_Database
          set(name, psk.data(), psk.size());
          }
 
-      virtual ~PSK_Database() = default;
+      virtual ~PSK_Database() {}
    };
 
 /**
diff --git a/src/lib/pubkey/ec_group/curve_gfp.h b/src/lib/pubkey/ec_group/curve_gfp.h
index 77c04ebf3..768e4d05c 100644
--- a/src/lib/pubkey/ec_group/curve_gfp.h
+++ b/src/lib/pubkey/ec_group/curve_gfp.h
@@ -21,7 +21,7 @@ namespace Botan {
 class BOTAN_UNSTABLE_API CurveGFp_Repr
    {
    public:
-      virtual ~CurveGFp_Repr() = default;
+      virtual ~CurveGFp_Repr() {}
 
       virtual const BigInt& get_p() const = 0;
       virtual const BigInt& get_a() const = 0;
diff --git a/src/lib/pubkey/ecc_key/ecc_key.h b/src/lib/pubkey/ecc_key/ecc_key.h
index ec2b5f9be..889651c1e 100644
--- a/src/lib/pubkey/ecc_key/ecc_key.h
+++ b/src/lib/pubkey/ecc_key/ecc_key.h
@@ -46,7 +46,7 @@ class BOTAN_PUBLIC_API(2,0) EC_PublicKey : public virtual Public_Key
 
       EC_PublicKey(const EC_PublicKey& other) = default;
       EC_PublicKey& operator=(const EC_PublicKey& other) = default;
-      virtual ~EC_PublicKey() = default;
+      virtual ~EC_PublicKey() {}
 
       /**
       * Get the public point of this key.
diff --git a/src/lib/pubkey/ecies/ecies.h b/src/lib/pubkey/ecies/ecies.h
index 1b35c8cc7..b1d7e0234 100644
--- a/src/lib/pubkey/ecies/ecies.h
+++ b/src/lib/pubkey/ecies/ecies.h
@@ -70,7 +70,7 @@ class BOTAN_PUBLIC_API(2,0) ECIES_KA_Params
       ECIES_KA_Params(const ECIES_KA_Params&) = default;
       ECIES_KA_Params& operator=(const ECIES_KA_Params&) = delete;
 
-      virtual ~ECIES_KA_Params() = default;
+      virtual ~ECIES_KA_Params() {}
 
       inline const EC_Group& domain() const
          {
@@ -151,7 +151,7 @@ class BOTAN_PUBLIC_API(2,0) ECIES_System_Params final : public ECIES_KA_Params
 
       ECIES_System_Params(const ECIES_System_Params&) = default;
       ECIES_System_Params& operator=(const ECIES_System_Params&) = delete;
-      virtual ~ECIES_System_Params() = default;
+      virtual ~ECIES_System_Params() {}
 
       /// creates an instance of the message authentication code
       std::unique_ptr<MessageAuthenticationCode> create_mac() const;
diff --git a/src/lib/pubkey/pk_keys.h b/src/lib/pubkey/pk_keys.h
index bf2be6bbd..35108eedb 100644
--- a/src/lib/pubkey/pk_keys.h
+++ b/src/lib/pubkey/pk_keys.h
@@ -31,7 +31,7 @@ class BOTAN_PUBLIC_API(2,0) Public_Key
       Public_Key() =default;
       Public_Key(const Public_Key& other) = default;
       Public_Key& operator=(const Public_Key& other) = default;
-      virtual ~Public_Key() = default;
+      virtual ~Public_Key() {}
 
       /**
       * Get the name of the underlying public key scheme.
@@ -183,7 +183,7 @@ class BOTAN_PUBLIC_API(2,0) Private_Key : public virtual Public_Key
       Private_Key() = default;
       Private_Key(const Private_Key& other) = default;
       Private_Key& operator=(const Private_Key& other) = default;
-      virtual ~Private_Key() = default;
+      virtual ~Private_Key() {}
 
       virtual bool stateful_operation() const { return false; }
 
@@ -301,7 +301,7 @@ class BOTAN_PUBLIC_API(2,0) PK_Key_Agreement_Key : public virtual Private_Key
       PK_Key_Agreement_Key() = default;
       PK_Key_Agreement_Key(const PK_Key_Agreement_Key&) = default;
       PK_Key_Agreement_Key& operator=(const PK_Key_Agreement_Key&) = default;
-      virtual ~PK_Key_Agreement_Key() = default;
+      virtual ~PK_Key_Agreement_Key() {}
    };
 
 /*
diff --git a/src/lib/pubkey/pk_ops.h b/src/lib/pubkey/pk_ops.h
index 63ef9fa9b..fadbb9844 100644
--- a/src/lib/pubkey/pk_ops.h
+++ b/src/lib/pubkey/pk_ops.h
@@ -44,7 +44,7 @@ class BOTAN_PUBLIC_API(2,0) Encryption
 
       virtual size_t ciphertext_length(size_t ptext_len) const = 0;
 
-      virtual ~Encryption() = default;
+      virtual ~Encryption() {}
    };
 
 /**
@@ -59,7 +59,7 @@ class BOTAN_PUBLIC_API(2,0) Decryption
 
       virtual size_t plaintext_length(size_t ctext_len) const = 0;
 
-      virtual ~Decryption() = default;
+      virtual ~Decryption() {}
    };
 
 /**
@@ -81,7 +81,7 @@ class BOTAN_PUBLIC_API(2,0) Verification
       */
       virtual bool is_valid_signature(const uint8_t sig[], size_t sig_len) = 0;
 
-      virtual ~Verification() = default;
+      virtual ~Verification() {}
    };
 
 /**
@@ -108,7 +108,7 @@ class BOTAN_PUBLIC_API(2,0) Signature
       */
       virtual size_t signature_length() const = 0;
 
-      virtual ~Signature() = default;
+      virtual ~Signature() {}
    };
 
 /**
@@ -123,7 +123,7 @@ class BOTAN_PUBLIC_API(2,0) Key_Agreement
 
       virtual size_t agreed_value_size() const = 0;
 
-      virtual ~Key_Agreement() = default;
+      virtual ~Key_Agreement() {}
    };
 
 /**
@@ -139,7 +139,7 @@ class BOTAN_PUBLIC_API(2,0) KEM_Encryption
                                const uint8_t salt[],
                                size_t salt_len) = 0;
 
-      virtual ~KEM_Encryption() = default;
+      virtual ~KEM_Encryption() {}
    };
 
 class BOTAN_PUBLIC_API(2,0) KEM_Decryption
@@ -151,7 +151,7 @@ class BOTAN_PUBLIC_API(2,0) KEM_Decryption
                                               const uint8_t salt[],
                                               size_t salt_len) = 0;
 
-      virtual ~KEM_Decryption() = default;
+      virtual ~KEM_Decryption() {}
    };
 
 }
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h
index 2aa8ea916..a682ad6ee 100644
--- a/src/lib/pubkey/pubkey.h
+++ b/src/lib/pubkey/pubkey.h
@@ -68,7 +68,7 @@ class BOTAN_PUBLIC_API(2,0) PK_Encryptor
       virtual size_t ciphertext_length(size_t ctext_len) const = 0;
 
       PK_Encryptor() = default;
-      virtual ~PK_Encryptor() = default;
+      virtual ~PK_Encryptor() {}
 
       PK_Encryptor(const PK_Encryptor&) = delete;
       PK_Encryptor& operator=(const PK_Encryptor&) = delete;
@@ -148,7 +148,7 @@ class BOTAN_PUBLIC_API(2,0) PK_Decryptor
       virtual size_t plaintext_length(size_t ctext_len) const = 0;
 
       PK_Decryptor() = default;
-      virtual ~PK_Decryptor() = default;
+      virtual ~PK_Decryptor() {}
 
       PK_Decryptor(const PK_Decryptor&) = delete;
       PK_Decryptor& operator=(const PK_Decryptor&) = delete;
diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h
index 54a8ea831..171aafd1e 100644
--- a/src/lib/rng/rng.h
+++ b/src/lib/rng/rng.h
@@ -25,7 +25,7 @@ class Entropy_Sources;
 class BOTAN_PUBLIC_API(2,0) RandomNumberGenerator
    {
    public:
-      virtual ~RandomNumberGenerator() = default;
+      virtual ~RandomNumberGenerator() {}
 
       RandomNumberGenerator() = default;
 
diff --git a/src/lib/stream/stream_cipher.h b/src/lib/stream/stream_cipher.h
index a07f21041..3c7f87faa 100644
--- a/src/lib/stream/stream_cipher.h
+++ b/src/lib/stream/stream_cipher.h
@@ -21,7 +21,7 @@ namespace Botan {
 class BOTAN_PUBLIC_API(2,0) StreamCipher : public SymmetricAlgorithm
    {
    public:
-      virtual ~StreamCipher() = default;
+      virtual ~StreamCipher() {}
 
       /**
       * Create an instance based on a name
diff --git a/src/lib/tls/asio/asio_context.h b/src/lib/tls/asio/asio_context.h
index e225fde6a..6726fe9e5 100644
--- a/src/lib/tls/asio/asio_context.h
+++ b/src/lib/tls/asio/asio_context.h
@@ -65,7 +65,7 @@ class Context
          m_server_info(server_info)
          {}
 
-      virtual ~Context() = default;
+      virtual ~Context() {}
 
       Context(Context&&)                 = default;
       Context(const Context&)            = delete;
diff --git a/src/lib/tls/asio/asio_stream.h b/src/lib/tls/asio/asio_stream.h
index bef95e44a..0c77c27fc 100644
--- a/src/lib/tls/asio/asio_stream.h
+++ b/src/lib/tls/asio/asio_stream.h
@@ -89,7 +89,7 @@ class Stream
          , m_input_buffer(m_input_buffer_space.data(), m_input_buffer_space.size())
          {}
 
-      virtual ~Stream() = default;
+      virtual ~Stream() {}
 
       Stream(Stream&& other) = default;
       Stream& operator=(Stream&& other) = default;
@@ -590,7 +590,7 @@ class Stream
          public:
             StreamCore(Stream& stream) : m_stream(stream) {}
 
-            virtual ~StreamCore() = default;
+            virtual ~StreamCore() {}
 
             void tls_emit_data(const uint8_t data[], std::size_t size) override
                {
diff --git a/src/lib/tls/credentials_manager.h b/src/lib/tls/credentials_manager.h
index 627894a87..07a460e90 100644
--- a/src/lib/tls/credentials_manager.h
+++ b/src/lib/tls/credentials_manager.h
@@ -30,7 +30,7 @@ class BigInt;
 class BOTAN_PUBLIC_API(2,0) Credentials_Manager
    {
    public:
-      virtual ~Credentials_Manager() = default;
+      virtual ~Credentials_Manager() {}
 
       /**
       * Return a list of the certificates of CAs that we trust in this
diff --git a/src/lib/tls/tls_blocking.h b/src/lib/tls/tls_blocking.h
index 01620c652..81f8666d2 100644
--- a/src/lib/tls/tls_blocking.h
+++ b/src/lib/tls/tls_blocking.h
@@ -69,7 +69,7 @@ class BOTAN_PUBLIC_API(2,0) Blocking_Client
       std::vector<X509_Certificate> peer_cert_chain() const
          { return m_channel.peer_cert_chain(); }
 
-      virtual ~Blocking_Client() = default;
+      virtual ~Blocking_Client() {}
 
    protected:
       /**
diff --git a/src/lib/tls/tls_callbacks.h b/src/lib/tls/tls_callbacks.h
index 995c02e2d..14b73b50e 100644
--- a/src/lib/tls/tls_callbacks.h
+++ b/src/lib/tls/tls_callbacks.h
@@ -40,7 +40,7 @@ class Certificate_Status_Request;
 class BOTAN_PUBLIC_API(2,0) Callbacks
    {
    public:
-       virtual ~Callbacks() = default;
+       virtual ~Callbacks() {}
 
        /**
        * Mandatory callback: output function
diff --git a/src/lib/tls/tls_extensions.h b/src/lib/tls/tls_extensions.h
index a426c8e56..c0cd4a680 100644
--- a/src/lib/tls/tls_extensions.h
+++ b/src/lib/tls/tls_extensions.h
@@ -72,7 +72,7 @@ class BOTAN_UNSTABLE_API Extension
       */
       virtual bool empty() const = 0;
 
-      virtual ~Extension() = default;
+      virtual ~Extension() {}
    };
 
 /**
diff --git a/src/lib/tls/tls_handshake_io.h b/src/lib/tls/tls_handshake_io.h
index 1c128726d..219412a5e 100644
--- a/src/lib/tls/tls_handshake_io.h
+++ b/src/lib/tls/tls_handshake_io.h
@@ -58,7 +58,7 @@ class Handshake_IO
 
       Handshake_IO& operator=(const Handshake_IO&) = delete;
 
-      virtual ~Handshake_IO() = default;
+      virtual ~Handshake_IO() {}
    };
 
 /**
diff --git a/src/lib/tls/tls_handshake_msg.h b/src/lib/tls/tls_handshake_msg.h
index a0d9346fb..394f0fa70 100644
--- a/src/lib/tls/tls_handshake_msg.h
+++ b/src/lib/tls/tls_handshake_msg.h
@@ -41,7 +41,7 @@ class BOTAN_PUBLIC_API(2,0) Handshake_Message
       */
       virtual std::vector<uint8_t> serialize() const = 0;
 
-      virtual ~Handshake_Message() = default;
+      virtual ~Handshake_Message() {}
    };
 
 }
diff --git a/src/lib/tls/tls_handshake_state.h b/src/lib/tls/tls_handshake_state.h
index 3321a6210..7687ba458 100644
--- a/src/lib/tls/tls_handshake_state.h
+++ b/src/lib/tls/tls_handshake_state.h
@@ -51,7 +51,7 @@ class Handshake_State
    public:
       Handshake_State(Handshake_IO* io, Callbacks& callbacks);
 
-      virtual ~Handshake_State() = default;
+      virtual ~Handshake_State() {}
 
       Handshake_State(const Handshake_State&) = delete;
       Handshake_State& operator=(const Handshake_State&) = delete;
diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h
index 4fbbd7545..1ef5fbe32 100644
--- a/src/lib/tls/tls_policy.h
+++ b/src/lib/tls/tls_policy.h
@@ -338,7 +338,7 @@ class BOTAN_PUBLIC_API(2,0) Policy
       */
       std::string to_string() const;
 
-      virtual ~Policy() = default;
+      virtual ~Policy() {}
    };
 
 typedef Policy Default_Policy;
diff --git a/src/lib/tls/tls_seq_numbers.h b/src/lib/tls/tls_seq_numbers.h
index 0a0a416f8..339e3c589 100644
--- a/src/lib/tls/tls_seq_numbers.h
+++ b/src/lib/tls/tls_seq_numbers.h
@@ -18,7 +18,7 @@ namespace TLS {
 class Connection_Sequence_Numbers
    {
    public:
-      virtual ~Connection_Sequence_Numbers() = default;
+      virtual ~Connection_Sequence_Numbers() {}
 
       virtual void new_read_cipher_state() = 0;
       virtual void new_write_cipher_state() = 0;
diff --git a/src/lib/tls/tls_session_manager.h b/src/lib/tls/tls_session_manager.h
index 40ca48f71..e6b5a3194 100644
--- a/src/lib/tls/tls_session_manager.h
+++ b/src/lib/tls/tls_session_manager.h
@@ -76,7 +76,7 @@ class BOTAN_PUBLIC_API(2,0) Session_Manager
       */
       virtual std::chrono::seconds session_lifetime() const = 0;
 
-      virtual ~Session_Manager() = default;
+      virtual ~Session_Manager() {}
    };
 
 /**
diff --git a/src/lib/utils/bswap.h b/src/lib/utils/bswap.h
index 584fa3323..15827f77a 100644
--- a/src/lib/utils/bswap.h
+++ b/src/lib/utils/bswap.h
@@ -24,11 +24,7 @@ namespace Botan {
 */
 inline uint16_t reverse_bytes(uint16_t val)
    {
-#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_XLC)
-   return __builtin_bswap16(val);
-#else
    return static_cast<uint16_t>((val << 8) | (val >> 8));
-#endif
    }
 
 /**
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h
index 832ab8f22..ff25fc0f1 100644
--- a/src/lib/utils/compiler.h
+++ b/src/lib/utils/compiler.h
@@ -190,6 +190,16 @@
 
 #endif
 
+#if !defined(BOTAN_ALIGNAS)
+
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 8)
+  #define BOTAN_ALIGNAS(x) /**/
+#else
+  #define BOTAN_ALIGNAS(x) alignas(x)
+#endif
+
+#endif
+
 /*
 * Define BOTAN_FORCE_INLINE
 */
diff --git a/src/lib/utils/data_src.h b/src/lib/utils/data_src.h
index 09c1bffdf..0364171bb 100644
--- a/src/lib/utils/data_src.h
+++ b/src/lib/utils/data_src.h
@@ -87,7 +87,7 @@ class BOTAN_PUBLIC_API(2,0) DataSource
       virtual size_t get_bytes_read() const = 0;
 
       DataSource() = default;
-      virtual ~DataSource() = default;
+      virtual ~DataSource() {}
       DataSource& operator=(const DataSource&) = delete;
       DataSource(const DataSource&) = delete;
    };
diff --git a/src/lib/utils/database.h b/src/lib/utils/database.h
index 713d4fc59..dea72be2b 100644
--- a/src/lib/utils/database.h
+++ b/src/lib/utils/database.h
@@ -67,7 +67,7 @@ class BOTAN_PUBLIC_API(2,0) SQL_Database
             /* Maybe update */
             virtual bool step() = 0;
 
-            virtual ~Statement() = default;
+            virtual ~Statement() {}
          };
 
       /*
@@ -80,7 +80,7 @@ class BOTAN_PUBLIC_API(2,0) SQL_Database
 
       virtual void create_table(const std::string& table_schema) = 0;
 
-      virtual ~SQL_Database() = default;
+      virtual ~SQL_Database() {}
 };
 
 }
diff --git a/src/lib/utils/os_utils.h b/src/lib/utils/os_utils.h
index d31dcb3ba..052074fd6 100644
--- a/src/lib/utils/os_utils.h
+++ b/src/lib/utils/os_utils.h
@@ -184,7 +184,7 @@ class BOTAN_UNSTABLE_API Echo_Suppression
       * Implicitly calls reenable_echo, but swallows/ignored all
       * errors which would leave the terminal in an invalid state.
       */
-      virtual ~Echo_Suppression() = default;
+      virtual ~Echo_Suppression() {}
    };
 
 /**
diff --git a/src/lib/utils/socket/socket.h b/src/lib/utils/socket/socket.h
index 03a951478..cf3fbe9d9 100644
--- a/src/lib/utils/socket/socket.h
+++ b/src/lib/utils/socket/socket.h
@@ -34,7 +34,7 @@ class BOTAN_TEST_API Socket
       /**
       * The socket will be closed upon destruction
       */
-      virtual ~Socket() = default;
+      virtual ~Socket() {}
 
       /**
       * Write to the socket. Blocks until all bytes sent.
diff --git a/src/lib/utils/socket/socket_udp.h b/src/lib/utils/socket/socket_udp.h
index 4a9346c2b..c76d8d3a7 100644
--- a/src/lib/utils/socket/socket_udp.h
+++ b/src/lib/utils/socket/socket_udp.h
@@ -34,7 +34,7 @@ class BOTAN_TEST_API SocketUDP
       /**
       * The socket will be closed upon destruction
       */
-      virtual ~SocketUDP() = default;
+      virtual ~SocketUDP() {}
 
       /**
       * Write to the socket. Returns immediately.
diff --git a/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp b/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp
index 9804759b9..18b541415 100644
--- a/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp
+++ b/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp
@@ -61,8 +61,8 @@ Flatfile_Certificate_Store::Flatfile_Certificate_Store(const std::string& file,
          {
          m_all_subjects.push_back(cert->subject_dn());
          m_dn_to_cert[cert->subject_dn()].push_back(cert);
-         m_pubkey_sha1_to_cert.emplace(cert->subject_public_key_bitstring_sha1(), cert);
-         m_subject_dn_sha256_to_cert.emplace(cert->raw_subject_dn_sha256(), cert);
+         m_pubkey_sha1_to_cert[cert->subject_public_key_bitstring_sha1()] = cert;
+         m_subject_dn_sha256_to_cert[cert->raw_subject_dn_sha256()] = cert;
          }
       else if(!ignore_non_ca)
          {
diff --git a/src/lib/x509/pkix_types.h b/src/lib/x509/pkix_types.h
index 983121955..f6eac4875 100644
--- a/src/lib/x509/pkix_types.h
+++ b/src/lib/x509/pkix_types.h
@@ -398,7 +398,7 @@ class BOTAN_PUBLIC_API(2,0) Certificate_Extension
             std::vector<std::set<Certificate_Status_Code>>& cert_status,
             size_t pos);
 
-      virtual ~Certificate_Extension() = default;
+      virtual ~Certificate_Extension() {}
    protected:
       friend class Extensions;
       virtual bool should_encode() const { return true; }
@@ -573,6 +573,8 @@ class BOTAN_PUBLIC_API(2,0) Extensions final : public ASN1_Object
       class Extensions_Info
          {
          public:
+            Extensions_Info() {}
+
             Extensions_Info(bool critical,
                             Certificate_Extension* ext) :
                m_obj(ext),
diff --git a/src/lib/x509/x509_ext.cpp b/src/lib/x509/x509_ext.cpp
index e81e15c18..83b80c1c6 100644
--- a/src/lib/x509/x509_ext.cpp
+++ b/src/lib/x509/x509_ext.cpp
@@ -133,7 +133,7 @@ void Extensions::add(Certificate_Extension* extn, bool critical)
    const OID oid = extn->oid_of();
    Extensions_Info info(critical, extn);
    m_extension_oids.push_back(oid);
-   m_extension_info.emplace(oid, info);
+   m_extension_info[oid] = info;
    }
 
 bool Extensions::add_new(Certificate_Extension* extn, bool critical)
@@ -147,7 +147,7 @@ bool Extensions::add_new(Certificate_Extension* extn, bool critical)
    const OID oid = extn->oid_of();
    Extensions_Info info(critical, extn);
    m_extension_oids.push_back(oid);
-   m_extension_info.emplace(oid, info);
+   m_extension_info[oid] = info;
    return true;
    }
 
@@ -171,7 +171,7 @@ void Extensions::replace(Certificate_Extension* extn, bool critical)
    const OID oid = extn->oid_of();
    Extensions_Info info(critical, extn);
    m_extension_oids.push_back(oid);
-   m_extension_info.emplace(oid, info);
+   m_extension_info[oid] = info;
    }
 
 bool Extensions::extension_set(const OID& oid) const
@@ -233,9 +233,10 @@ std::map<OID, std::pair<std::vector<uint8_t>, bool>> Extensions::extensions_raw(
    std::map<OID, std::pair<std::vector<uint8_t>, bool>> out;
    for(auto&& ext : m_extension_info)
       {
-      out.emplace(ext.first,
-                  std::make_pair(ext.second.bits(),
-                                 ext.second.is_critical()));
+      const auto bits = ext.second.bits();
+      const bool is_critical = ext.second.is_critical();
+
+      out[ext.first] = std::make_pair(bits, is_critical);
       }
    return out;
    }
@@ -290,7 +291,7 @@ void Extensions::decode_from(BER_Decoder& from_source)
       Extensions_Info info(critical, bits, obj.release());
 
       m_extension_oids.push_back(oid);
-      m_extension_info.emplace(oid, info);
+      m_extension_info[oid] = info;
       }
    sequence.verify_end();
    }
diff --git a/src/lib/x509/x509_obj.h b/src/lib/x509/x509_obj.h
index fd972aed9..2690d6a5f 100644
--- a/src/lib/x509/x509_obj.h
+++ b/src/lib/x509/x509_obj.h
@@ -113,7 +113,7 @@ class BOTAN_PUBLIC_API(2,0) X509_Object : public ASN1_Object
       virtual std::vector<std::string> alternate_PEM_labels() const
          { return std::vector<std::string>(); }
 
-      virtual ~X509_Object() = default;
+      virtual ~X509_Object() {}
 
       static std::unique_ptr<PK_Signer>
          choose_sig_format(AlgorithmIdentifier& sig_algo,
diff --git a/src/lib/x509/x509path.cpp b/src/lib/x509/x509path.cpp
index 6f3159a26..73e85d545 100644
--- a/src/lib/x509/x509path.cpp
+++ b/src/lib/x509/x509path.cpp
@@ -740,7 +740,7 @@ PKIX::build_all_certificate_paths(std::vector<std::vector<std::shared_ptr<const
 
          // push the latest certificate onto the path_so_far
          path_so_far.push_back(last);
-         certs_seen.emplace(fprint);
+         certs_seen.insert(fprint);
 
          // push a deletion marker on the stack for backtracing later
          stack.push_back({std::shared_ptr<const X509_Certificate>(nullptr),false});


Test patch:
diff --git a/src/cli/timing_tests.cpp b/src/cli/timing_tests.cpp
index a9904ae2e..210cd5edd 100644
--- a/src/cli/timing_tests.cpp
+++ b/src/cli/timing_tests.cpp
@@ -73,7 +73,7 @@ class Timing_Test
          m_rng = cli_make_rng("", drbg_seed); // throws if it can't find anything to use
          }
 
-      virtual ~Timing_Test() = default;
+      virtual ~Timing_Test() {}
 
       std::vector<std::vector<ticks>> execute_evaluation(
                                       const std::vector<std::string>& inputs,
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index 424a37cf9..7d9407f32 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -93,13 +93,13 @@ class BigInt_Unit_Tests final : public Test
 
          result.test_throws("Invalid bit size",
                             "random_prime: Can't make a prime of 0 bits",
-                            []() { Botan::random_prime(Test::rng(), 0); });
+                            [this]() { Botan::random_prime(Test::rng(), 0); });
          result.test_throws("Invalid bit size",
                             "random_prime: Can't make a prime of 1 bits",
-                            []() { Botan::random_prime(Test::rng(), 1); });
+                            [this]() { Botan::random_prime(Test::rng(), 1); });
          result.test_throws("Invalid arg",
                             "random_prime Invalid value for equiv/modulo",
-                            []() { Botan::random_prime(Test::rng(), 2, 1, 0, 2); });
+                            [this]() { Botan::random_prime(Test::rng(), 2, 1, 0, 2); });
 
          BigInt p = Botan::random_prime(Test::rng(), 2);
          result.confirm("Only two 2-bit primes", p == 2 || p == 3);
diff --git a/src/tests/test_dl_group.cpp b/src/tests/test_dl_group.cpp
index 9445bf075..5937d15cf 100644
--- a/src/tests/test_dl_group.cpp
+++ b/src/tests/test_dl_group.cpp
@@ -43,7 +43,7 @@ class DL_Group_Tests final : public Test
 #if !defined(BOTAN_HAS_SANITIZER_UNDEFINED)
          result.test_throws("Bad generator param",
                             "DL_Group unknown PrimeType",
-                            []() {
+                            [this]() {
                             auto invalid_type = static_cast<Botan::DL_Group::PrimeType>(9);
                             Botan::DL_Group dl(Test::rng(), invalid_type, 1024);
              });
diff --git a/src/tests/test_passhash.cpp b/src/tests/test_passhash.cpp
index 849163322..f838652c2 100644
--- a/src/tests/test_passhash.cpp
+++ b/src/tests/test_passhash.cpp
@@ -69,7 +69,7 @@ class Bcrypt_Tests final : public Text_Based_Test
 
          result.test_throws("Invalid bcrypt version rejected",
                             "Unknown bcrypt version 'q'",
-                            []() { Botan::generate_bcrypt("pass", Test::rng(), 4, 'q'); });
+                            [this]() { Botan::generate_bcrypt("pass", Test::rng(), 4, 'q'); });
 
          result.set_ns_consumed(Test::timestamp() - start);
 
@@ -192,7 +192,7 @@ class Passhash9_Tests final : public Text_Based_Test
 
          result.test_throws("Throws if algorithm not supported",
                             "Passhash9: Algorithm id 255 is not defined",
-                            []() { Botan::generate_passhash9("pass", Test::rng(), 3, 255); });
+                            [this]() { Botan::generate_passhash9("pass", Test::rng(), 3, 255); });
 
          result.test_throws("Throws if iterations is too high",
                             "Requested passhash9 work factor 513 is too large",
diff --git a/src/tests/test_pkcs11_low_level.cpp b/src/tests/test_pkcs11_low_level.cpp
index 69772e10e..44e23a6c8 100644
--- a/src/tests/test_pkcs11_low_level.cpp
+++ b/src/tests/test_pkcs11_low_level.cpp
@@ -713,7 +713,7 @@ std::map < AttributeType, std::vector<uint8_t>> get_attribute_values(const RAII_
 
    for(const auto& type : attribute_types)
       {
-      received_attributes.emplace(type, std::vector<uint8_t>());
+      received_attributes[type] = std::vector<uint8_t>();
       }
 
    p11_low_level.get()->C_GetAttributeValue(session_handle, object_handle, received_attributes);
diff --git a/src/tests/test_tls_stream_integration.cpp b/src/tests/test_tls_stream_integration.cpp
index f11f134f3..3d6e09895 100644
--- a/src/tests/test_tls_stream_integration.cpp
+++ b/src/tests/test_tls_stream_integration.cpp
@@ -328,7 +328,7 @@ class TestBase
            m_server(server),
            m_result(ioc, name) {}
 
-      virtual ~TestBase() = default;
+      virtual ~TestBase() {}
 
       virtual void finishAsynchronousWork() {}
 
diff --git a/src/tests/tests.h b/src/tests/tests.h
index 05e5e5ffe..c8b750bdf 100644
--- a/src/tests/tests.h
+++ b/src/tests/tests.h
@@ -427,7 +427,7 @@ class Test
             std::vector<std::string> m_log;
          };
 
-      virtual ~Test() = default;
+      virtual ~Test() {}
       virtual std::vector<Test::Result> run() = 0;
 
       virtual std::vector<std::string> possible_providers(const std::string&);
diff --git a/src/tests/unit_asio_stream.cpp b/src/tests/unit_asio_stream.cpp
index 67f35bff7..a7fbbf7a4 100644
--- a/src/tests/unit_asio_stream.cpp
+++ b/src/tests/unit_asio_stream.cpp
@@ -116,7 +116,7 @@ class AsioStream : public Botan::TLS::Stream<TestStream, MockChannel>
          m_native_handle = std::unique_ptr<MockChannel>(new MockChannel(m_core));
          }
 
-      virtual ~AsioStream() = default;
+      virtual ~AsioStream() {}
    };
 
 class ThrowingAsioStream : public Botan::TLS::Stream<TestStream, ThrowingMockChannel>
@@ -129,7 +129,7 @@ class ThrowingAsioStream : public Botan::TLS::Stream<TestStream, ThrowingMockCha
          m_native_handle = std::unique_ptr<ThrowingMockChannel>(new ThrowingMockChannel(m_core));
          }
 
-      virtual ~ThrowingAsioStream() = default;
+      virtual ~ThrowingAsioStream() {}
    };
 
 /**