This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Support -std=iso9899:199409 -pedantic


Hi!

Is there any reason why we can't support this?  The needed changes are about
as long as the CONFORMANCE paragraph explaining it is unsupported.
I have skimmed the whole AMD1 and checked -std=iso9899:199409 -pedantic -E
-dD output of wctype.h and wchar.h to make sure it defines what is needed
and doesn't define anything undesirable.

2007-07-18  Jakub Jelinek  <jakub@redhat.com>

	* include/features.h (__USE_ISOC95): New define.
	* wcsmbs/wchar.h (fwprintf, fwscanf, wprintf, wscanf, swprintf,
	swscanf, vfwprintf, vwprintf, vswprintf, fwide): Define even
	for -std=iso9899:199409.
	* CONFORMANCE: Remove comments about unsupported AMD1.

--- libc/include/features.h.jj	2007-07-03 12:36:59.000000000 +0200
+++ libc/include/features.h	2007-07-18 12:50:06.000000000 +0200
@@ -56,6 +56,7 @@
    header files to decide what to declare or define:
 
    __USE_ISOC99		Define ISO C99 things.
+   __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
    __USE_POSIX		Define IEEE Std 1003.1 things.
    __USE_POSIX2		Define IEEE Std 1003.2 things.
    __USE_POSIX199309	Define IEEE Std 1003.1, and .1b things.
@@ -90,6 +91,7 @@
 
 /* Undefine everything, so we get a clean slate.  */
 #undef	__USE_ISOC99
+#undef	__USE_ISOC95
 #undef	__USE_POSIX
 #undef	__USE_POSIX2
 #undef	__USE_POSIX199309
@@ -184,6 +186,12 @@
 # define __USE_ISOC99	1
 #endif
 
+/* This is to enable the ISO C90 Amendment 1:1995 extension.  */
+#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
+     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
+# define __USE_ISOC95	1
+#endif
+
 /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
    (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined).  */
 #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \
--- libc/wcsmbs/wchar.h.jj	2007-07-17 13:21:11.000000000 +0200
+++ libc/wcsmbs/wchar.h	2007-07-18 12:52:57.000000000 +0200
@@ -613,7 +613,7 @@ extern wchar_t *wcpncpy (wchar_t *__dest
 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
 #endif
 
-#if defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_ISOC95 || defined __USE_UNIX98
 __BEGIN_NAMESPACE_C99
 
 /* Select orientation for stream.  */
@@ -680,7 +680,7 @@ extern int swscanf (__const wchar_t *__r
      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
 
 __END_NAMESPACE_C99
-#endif /* Use ISO C99 and Unix98. */
+#endif /* Use ISO C95, C99 and Unix98. */
 
 #ifdef __USE_ISOC99
 __BEGIN_NAMESPACE_C99
--- libc/CONFORMANCE.jj	2007-07-17 19:08:34.000000000 +0200
+++ libc/CONFORMANCE	2007-07-18 12:56:24.000000000 +0200
@@ -85,11 +85,9 @@ of the C standard (as indicated by __STD
 GCC options		Standard version
 -ansi			ISO/IEC 9899:1990
 -std=c89		ISO/IEC 9899:1990
--std=iso9899:199409	ISO/IEC 9899:1990 as amended by Amd.1:1995 *
+-std=iso9899:199409	ISO/IEC 9899:1990 as amended by Amd.1:1995
 -std=c99		ISO/IEC 9899:1999
 
-* glibc does not support this standard version.
-
 (Note that -std=c99 is not available in GCC 2.95.2, and that no
 version of GCC presently existing implements the full C99 standard.)
 
@@ -183,8 +181,3 @@ Note that the _t suffix is reserved by P
 Also, the Single Unix Specification generally requires more types to
 be included in headers (if _XOPEN_SOURCE is defined appropriately)
 than ISO C permits.
-
-<wchar.h> does not support AMD1; to support it, the functions
-fwprintf, fwscanf, wprintf, wscanf, swprintf, swscanf, vfwprintf,
-vwprintf, vswprintf and fwide would need to be declared when
-__STDC_VERSION__ >= 199409L and not just for C99.

	Jakub


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