Hardcoded value of GMP_LIMB_BITS impedes bi-arch builds

Torbjörn Granlund tg at gmplib.org
Wed Sep 30 09:28:18 UTC 2020


Jan Engelhardt <jengelh at inai.de> writes:

  When ./configure has run, the GMP_LIMB_BITS define in gmp.h is hardcoded 
  to 32 or 64, depending on arch. This makes it impossible to use that 
  header file for a x86_64-driven build with gcc -m32.
  It is my (naive) view that declaring

  	#define GMP_LIMB_BITS (sizeof(mp_limb_t) * CHAR_BIT)

  could address the issue in short order, though, upon last minute 
  searching, I find this problem to have been previously reported in 
  https://gmplib.org/list-archives/gmp-bugs/2012-March/002593.html with no 
  action taken.

No action taken indeed.

If you try compiling that change, you will quickly notice why no action
was taken.  Or, try something much simpler to see the problem:

#define FOO sizeof(int)
#if FOO == 4711
#endif

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


More information about the gmp-bugs mailing list