![]() | ![]() | ||||||||||||
[bug-gsl] Missing extern "C" because of symbol redefinition. GSL 1.9, g++ (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) (2008-10-12)
"sys/infnan.c", "sys/hypot.c" and "sys/coerce.c" include forward function symbol declarations that redefine the symbols in the header files. The new definitions drop the extern "C". When compiling with a c++ compiler, the function turns out to have a mangled c++ symbol name yet they are referenced as if they were C symbols. =============================================================================================================================== diff -rb gsl-1.9/rng/file.c gsl-1.9-patched/rng/file.c 30c30 < char * state = r->state; --- > char * state = (char*)(r->state); 47c47 < char * state = r->state; --- > char * state = (char*)(r->state); diff -rb gsl-1.9/sys/coerce.c gsl-1.9-patched/sys/coerce.c 22a23,35 > #undef __BEGIN_DECLS > #undef __END_DECLS > #ifdef __cplusplus > # define __BEGIN_DECLS extern "C" { > # define __END_DECLS } > #else > # define __BEGIN_DECLS /* empty */ > # define __END_DECLS /* empty */ > #endif > > __BEGIN_DECLS > > 54a68 > __END_DECLS diff -rb gsl-1.9/sys/fdiv.c gsl-1.9-patched/sys/fdiv.c 22a23,34 > #undef __BEGIN_DECLS > #undef __END_DECLS > #ifdef __cplusplus > # define __BEGIN_DECLS extern "C" { > # define __END_DECLS } > #else > # define __BEGIN_DECLS /* empty */ > # define __END_DECLS /* empty */ > #endif > > __BEGIN_DECLS > 29a42,43 > > __END_DECLS diff -rb gsl-1.9/sys/hypot.c gsl-1.9-patched/sys/hypot.c 22a23,35 > #undef __BEGIN_DECLS > #undef __END_DECLS > #ifdef __cplusplus > # define __BEGIN_DECLS extern "C" { > # define __END_DECLS } > #else > # define __BEGIN_DECLS /* empty */ > # define __END_DECLS /* empty */ > #endif > > __BEGIN_DECLS > > 48a62 > __END_DECLS diff -rb gsl-1.9/sys/infnan.c gsl-1.9-patched/sys/infnan.c 26a27,39 > #undef __BEGIN_DECLS > #undef __END_DECLS > #ifdef __cplusplus > # define __BEGIN_DECLS extern "C" { > # define __END_DECLS } > #else > # define __BEGIN_DECLS /* empty */ > # define __END_DECLS /* empty */ > #endif > > __BEGIN_DECLS > > 147a161 > __END_DECLS =============================================================================================================================== Thanks, -- Joshua Shaffer
| |||||||||||||
![]() | ![]() |







