Compilation fails when inttypes.h without uint_least32_t definition present but stdint.h with definition present

Vincent Lefevre vincent at
Mon May 24 09:18:53 UTC 2021

On 2021-05-24 10:31:05 +0200, Marc Glisse wrote:
> There was a suggestion in the other thread to change GMP-6.* to include
> stdint.h if present, independently of inttypes.h (move the code outside of
> #else). That does look like a simple idea, I don't expect too many platforms
> to have conflicts between the 2 headers.

FYI, this is what I did for MPFR in 2010:

r7083 | vlefevre | 2010-08-16 11:21:21 +0200 (Mon, 16 Aug 2010) | 12 lines

Avoid a compilation failure on OSF/1 (Tru64) 5.1 due to non-C99
conformance though <inttypes.h> is available. In various source
files and m4 files, use the following form only:

# include <inttypes.h>
# include <stdint.h>

Updated to mention this form.

Vincent Lefèvre <vincent at> - Web: <>
100% accessible validated (X)HTML - Blog: <>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-bugs mailing list