Compiling with C++

Torbjörn Granlund tg at gmplib.org
Mon Nov 17 19:34:18 UTC 2014


Marc Glisse <marc.glisse at inria.fr> writes:

  Interesting, we don't have a big extern "C" in longlong.h, I am
  surprised we didn't hit issues with that earlier.
  
It puzzled me too, but now I see why; longlong.h is quite innocent.

These references are made only if HAVE_NATIVE_mpn_umul_ppmm, which
happens if the config provides umul_ppmm as a function.  Now, x86
(32-bit) provides that for all configs via in mpn/x86/umul.asm, but
x86_64 does not.

I am not sure how to best address this.  The motivation for these
umul.asm files was to support non-GCC compilers better.

Alternatives:

1. Remove the umul.asm files, and then the code depending on them in
   longlong.h and tune/common.c (and perhaps more places).  This will
   hurt proprietary compilers (and perhaps also clang).

2. Put extern "C" {....} in some good place around mpn_umul_ppmm and
   mpn_udiv_qrnnd.  Perhaps longlong.h is the right place.  Or perhaps
   gmp-impl.h.

3. Something else.

  Seems to be mostly just the glibc 'throw()' thing.

OK.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-discuss mailing list