Hi,

I realize that Chicken is a C library, but when using it in C++11, I get a 
compilation error because of mismatched math function declarations, for example:
   /usr/local/include/chicken/chicken.h:1036:27: error: declaration of ‘double 
trunc(double)’ has a different exception specifier
 extern double trunc(double);

That was from gcc 4.9.1. I have attached full error output.

Adding throw() to the definitions in chicken.h fixed it, although that will 
obviously break if I use it as a C library. So, you might want to add some 
extra guards in the header file for C++11 compilation in the next release.

-- 
Izaak
g++ -ggdb -Wall -Wextra -Werror -pedantic -std=c++11  -I/usr/local/include 
-I/home/myuser/Elymus   -c -o /home/myuser/Elymus/main.o 
/home/myuser/Elymus/main.cpp
In file included from /home/myuser/Elymus/main.cpp:6:0:
/usr/local/include/chicken/chicken.h:1035:27: error: declaration of ‘double 
round(double)’ has a different exception specifier
 extern double round(double);
                           ^
In file included from /usr/include/features.h:374:0,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.9/bits/os_defines.h:39,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++config.h:430,
                 from /usr/include/c++/4.9/cstdlib:41,
                 from /home/myuser/Elymus/main.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:309:1: error: from previous 
declaration ‘double round(double) throw ()’
 __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
 ^
In file included from /home/myuser/Elymus/main.cpp:6:0:
/usr/local/include/chicken/chicken.h:1036:27: error: declaration of ‘double 
trunc(double)’ has a different exception specifier
 extern double trunc(double);
                           ^
In file included from /usr/include/features.h:374:0,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.9/bits/os_defines.h:39,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.9/bits/c++config.h:430,
                 from /usr/include/c++/4.9/cstdlib:41,
                 from /home/myuser/Elymus/main.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:313:1: error: from previous 
declaration ‘double trunc(double) throw ()’
 __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
 ^
<builtin>: recipe for target '/home/myuser/Elymus/main.o' failed
make: *** [/home/myuser/Elymus/main.o] Error 1
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to