* [PATCH] Support -std=iso9899:199409 -pedantic
@ 2007-07-18 11:11 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2007-07-18 11:11 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-18 11:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 11:11 [PATCH] Support -std=iso9899:199409 -pedantic Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).