This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Enabling __USE_ISOC99 with gcc -std=c99
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: Enabling __USE_ISOC99 with gcc -std=c99
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Sat, 8 Jul 2000 17:17:45 +0100 (BST)
If the programmer is using the compiler in C99 mode, it makes little sense
for glibc to provide only a C89 library. (In particular, gcc -std=c99
-pedantic should provide the C99 environment without needing additional
feature test macros.) This patch turns on __USE_ISOC99 if
__STDC_VERSION__ indicates a C99 compiler.
--- features.h Sat Jul 8 16:12:09 2000
+++ features.h.new Sat Jul 8 16:12:52 2000
@@ -152,7 +152,8 @@
which was used prior to the standard acceptance. This macro will
eventually go away and the features enabled by default once the ISO C99
standard is widely adopted. */
-#if defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE || \
+ (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99 1
#endif
--
Joseph S. Myers
jsm28@cam.ac.uk