[PATCH] stdint: Use __extension__ on long long constants

Florian Weimer fweimer@redhat.com
Tue Feb 25 07:57:00 GMT 2020


* Dennis Lambe, Jr.:

> Most uses of long long in stdint.h are guarded with __extension__ to
> prevent them from issuing warnings with -std=c89 -pedantic. However,
> on 32-bit platforms the 64-bit integer constant macros append LL or
> ULL without marking it as an __extension__.
>
> As a result, GCC issues this warning:
>
>     $ gcc -m32 -std=c89 -pedantic -c -o stdintext.o stdintext.c
>     In file included from stdint.h:9:0,
>                      from stdintext.c:1:
>     stdintext.c:3:23: warning: use of C99 long long integer constant
> [-Wlong-long]
>      uint64_t i = UINT64_C(0);
>
> Prefix all ## LL and ## ULL macros with __extension__ to suppress
> these warnings.

I think users who use <stdint.h> in C89 mode expect such warnings
because such usages cannot be made compatible with C89 compilers
without long long support.

Thanks,
Florian



More information about the Libc-alpha mailing list