Compiling a C program with g++ 4.3.1 yields an error about std::FILE

Torbjorn Granlund tg at swox.com
Fri Jul 25 14:11:13 CEST 2008


Marc Glisse <marc.glisse at normalesup.org> writes:

  "safe": I am quite sure it is correct (whereas the current code isn't), it 
  helps with sunpro, and it does not break g++-4.3. I don't have much else 
  available here to test on...
  
It turns out that gcc 2.95 has problems with the new code.  Yes, some
of my test machines still use that old compiler.  :-)

The error is:

  gmpxx.h:1349: multiple storage classes in declaration of `__gmp_freefunc_t'

At line 1349, we have this new line:

  extern "C" typedef void (*__gmp_freefunc_t) (void *, size_t);

I'd like to make the code work with 2.95, if possible.

What would a correct alternatve form for older c++ compilers be?  Just
dropping the 'extern "C"' seems to help with this particular gcc
release.

-- 
Torbjörn


More information about the gmp-bugs mailing list