From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24142 invoked by alias); 18 Jul 2007 11:11:23 -0000 Received: (qmail 24126 invoked by uid 22791); 18 Jul 2007 11:11:22 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 18 Jul 2007 11:11:19 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l6IBEpBg018043; Wed, 18 Jul 2007 13:14:51 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l6IBEorU018042; Wed, 18 Jul 2007 13:14:50 +0200 Date: Wed, 18 Jul 2007 11:11:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Support -std=iso9899:199409 -pedantic Message-ID: <20070718111450.GA4603@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00032.txt.bz2 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 * 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. - - 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