uint_least32_t is in stdint.h not in inttypes.h

Felix von Leitner felix-gmplib at fefe.de
Sun Nov 15 21:21:18 UTC 2020


Dear gmp team,

I was trying to compile gmp with my libc, dietlibc, and got an error
that uint_least32_t is not defined.

Well, it is defined, and as far as I can tell in the right header file,
too: stdint.h.

However, gmp-impl.h reads as follows:

 155 #if HAVE_INTTYPES_H      /* for uint_least32_t */
 156 # include <inttypes.h>
 157 #else
 158 # if HAVE_STDINT_H
 159 #  include <stdint.h>
 160 # endif
 161 #endif

Note that stdint.h is in the else clause. dietlibc has both inttypes.h and stdint.h.

For reference, please see:

https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html

https://en.cppreference.com/w/c/types/integer


Proposed fix: Move the #if HAVE_STDINT_H outside the previous #if.

Regards,

Felix


More information about the gmp-bugs mailing list