Reserved names in C++ [Was: Re: mingw __dllexport__]

Kevin Ryde user42@zip.com.au
Mon, 18 Nov 2002 06:34:05 +1000


Roberto Bagnara <bagnara@cs.unipr.it> writes:
>
> I don't know if strict conformance to standards is one of GMP's goals.
> If it is, it would be better to avoid using names that are reserved
> to the language's implementation.

The rule we're working to is that _foo belongs to the compiler and
libc, and __foo is for third party libraries, or something like that.

For practical purposes annexing __gmp* at the symbol level and gmp*
and some mp* in gmp.h shouldn't be in too much danger of clashing with
unrelated stuff.

I guess in the libgmpxx routines we've ended up with __mpz_struct
getting into the mangling, where __gmpz_struct might have been better.
Alas doing anything about that would break binary compatibility.