This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ compile problem using inttypes.h
- From: Ian Lance Taylor <iant at google dot com>
- To: Lars Schoenberg <lars dot schoenberg at email dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 24 Oct 2006 07:32:18 -0700
- Subject: Re: g++ compile problem using inttypes.h
- References: <6970711.post@talk.nabble.com>
Lars Schoenberg <lars.schoenberg@email.de> writes:
> intmax2.c: In function 'int main()':
> intmax2.c:10: error: expected `)' before 'PRIx64'
This looks like a problem with <inttypes.h>, not with g++.
I took a look at <inttypes.h> on my Fedora Core 4 system which uses
glibc 2.3.6. I see this:
/* The ISO C99 standard specifies that these macros must only be
defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
around the definition of all the PRIxx macros. This means that the
PRIxx macros will only be defined for C++ if you define
__STDC_FORMAT_MACROS in the preprocessor. I have no idea why it works
this way. <inttypes.h> is part of glibc, not gcc, so I suggest that
you ask there. See
http://gnu.org/software/libc/
Ian