mdhender / aegis

Peter Miller's aegis source code
GNU Affero General Public License v3.0
3 stars 1 forks source link

Compile problem and solution #1

Open ViktorBodrogi opened 2 years ago

ViktorBodrogi commented 2 years ago

Problem

Got many warnings and finally an error related to: warning: dynamic exception specifications are deprecated in C++11

Solution

Edited common/config.h: #define HAVE_HEADER_NEW 0

pgeorgi commented 1 year ago

A more complete solution is

diff -ur aegis-4.25/common/mem.h aegis-4.25.try1/common/mem.h
--- aegis-4.25/common/mem.h     2012-12-04 03:03:31.000000000 +0100
+++ aegis-4.25/common/mem.h        2022-07-13 23:34:36.827980165 +0200
@@ -122,7 +122,7 @@
    dmem_copy_string(__FILE__, __LINE__, (p), ## __VA_ARGS__)
 #endif

-#if HAVE_HEADER_NEW || HAVE_NEW_H
+#if (HAVE_HEADER_NEW || HAVE_NEW_H) &&  __cplusplus < 201703L
 #define THROW_BAD_ALLOC throw(std::bad_alloc)
 #else
 #define THROW_BAD_ALLOC

It disables this exception specification in C++17 and newer as support for it was removed in that language version.