This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ compile problem using inttypes.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]