Various patches against gmp-4.3.0

Marc Glisse marc.glisse at
Wed May 6 11:51:32 CEST 2009

On Wed, 6 May 2009, Torbjorn Granlund wrote:

>  >  Without the extern "C", the variable "point_string" is subject to C++ name
>  >  mangling: on win32 it becomes "?point_string@@3PADA", leaving an unresolved
>  >  symbol  "_point_string".
>  >
>  > Well, this is a C++ file, point_string is supposed to be a C++ variable,
>  > so if your compiler mangles its use but not its declaration, it sounds
>  > like a serious compiler problem.
>  Apparently this variable is shared with the C file clocale.c, so I
>  think it makes sense that there can be problems. Although I am not
>  sure the standard allows the C++ compiler to mangle the names of
>  arrays (only functions).
> Could an
>  extern "C"
> cause problems for standard conforming compilers?

I don't think so. But then again I didn't think there would be a problem 
without it. I am surprised nobody seems to have hit this problem before 
(MPIR has the same code there and no related bug report in their system, 
although they are supposed to compile for windows not only with cygwin).

Bah, the extern "C" { ... } should not hurt.

Marc Glisse

More information about the gmp-devel mailing list