Enabling __USE_ISOC99 with gcc -std=c99

Joseph S. Myers jsm28@cam.ac.uk
Sat Jul 8 09:17:00 GMT 2000


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



More information about the Libc-alpha mailing list