From 5ded58d0e10310c317f6db232d14a6beadb577f1 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Thu, 22 May 2003 17:03:57 +0000 Subject: [PATCH] re PR other/2873 ([3.3 only][fixinclude] Bogus fixinclude of stdio.h from glibc 2.2.3) PR other/2873 * fixinc/inclhack.def (avoid_wchar_t_type): Add bypass expressions to prevent triggering on recent curses.h, linux/nls.h, or X11/Xlib.h. (stdio_va_list): Add _G_va_list to bypass pattern. (strict_ansi_not): Add bypass pattern for __SCO_VERSION__. * fixinc/fixincl.x: Regenerate. From-SVN: r67090 --- gcc/ChangeLog | 22 ++++++++++++++++------ gcc/fixinc/fixincl.x | 34 ++++++++++++++++++++++++---------- gcc/fixinc/inclhack.def | 19 ++++++++++++++++--- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9696910053d..672b54bc5b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,7 +1,17 @@ +2003-05-22 Zack Weinberg + + PR other/2873 + * fixinc/inclhack.def (avoid_wchar_t_type): Add bypass + expressions to prevent triggering on recent curses.h, + linux/nls.h, or X11/Xlib.h. + (stdio_va_list): Add _G_va_list to bypass pattern. + (strict_ansi_not): Add bypass pattern for __SCO_VERSION__. + * fixinc/fixincl.x: Regenerate. + 2003-05-22 Rekha Bhintade * gcc/config/sh/sh.h (TARGET_SWITCHES): Display all the target - switches when --target-help option is specified. + switches when --target-help option is specified. 2003-05-22 Eric Botcazou @@ -177,12 +187,12 @@ 2003-05-19 Seth Arnold Aldy Hernandez - * config/rs6000/rs6000.c (rs6000_stack_info): Do not add - vrsave_size twice. + * config/rs6000/rs6000.c (rs6000_stack_info): Do not add + vrsave_size twice. 2003-05-19 Aldy Hernandez - * doc/tm.texi (function_arg): Fix typo. + * doc/tm.texi (function_arg): Fix typo. 2003-05-19 Matt Austern @@ -192,9 +202,9 @@ * doc/invoke.texi: Document -Winvalid-offsetof. * testsuite/g++.dg/other/offsetof3.C: New. * testsuite/g++.dg/other/offsetof4.C: New. - + 2003-05-19 Kevin B. Hendricks - David Edelsohn + David Edelsohn * config/rs6000/rs6000.c (rs6000_alignment_string, rs6000_alignment_flags): New variables. diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index c3155940b08..84239e70a1e 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Saturday May 3, 2003 at 03:55:13 PM PDT + * It has been AutoGen-ed Thursday May 22, 2003 at 10:03:21 AM PDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Sat May 3 15:55:13 PDT 2003 +/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 22 10:03:21 PDT 2003 * * You must regenerate it. Use the ./genfixes script. * @@ -276,14 +276,12 @@ fix = {\n\ files = sys/varargs.h;\n\ replace = \"/* This file was generated by fixincludes. */\\n\"\n\ \"#ifndef _SYS_VARARGS_H\\n\"\n\ - \"#define _SYS_VARARGS_H\\n\\n\"\n\ - \n\ + \"#define _SYS_VARARGS_H\\n\\n\"\n\n\ \"#ifdef __STDC__\\n\"\n\ \"#include \\n\"\n\ \"#else\\n\"\n\ \"#include \\n\"\n\ - \"#endif\\n\\n\"\n\ - \n\ + \"#endif\\n\\n\"\n\n\ \"#endif /* _SYS_VARARGS_H */\\n\";\n\ };\n\ #endif\n\n\n\ @@ -1005,8 +1003,21 @@ tSCC zAvoid_Wchar_T_TypeName[] = tSCC zAvoid_Wchar_T_TypeSelect0[] = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;"; -#define AVOID_WCHAR_T_TYPE_TEST_CT 1 +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zAvoid_Wchar_T_TypeBypass0[] = + "we must use the C\\+\\+ compiler's type"; +tSCC zAvoid_Wchar_T_TypeBypass1[] = + "_LINUX_NLS_H"; +tSCC zAvoid_Wchar_T_TypeBypass2[] = + "XFree86: xc/lib/X11/Xlib\\.h"; + +#define AVOID_WCHAR_T_TYPE_TEST_CT 4 static tTestDesc aAvoid_Wchar_T_TypeTests[] = { + { TT_NEGREP, zAvoid_Wchar_T_TypeBypass0, (regex_t*)NULL }, + { TT_NEGREP, zAvoid_Wchar_T_TypeBypass1, (regex_t*)NULL }, + { TT_NEGREP, zAvoid_Wchar_T_TypeBypass2, (regex_t*)NULL }, { TT_EGREP, zAvoid_Wchar_T_TypeSelect0, (regex_t*)NULL }, }; /* @@ -4125,7 +4136,7 @@ tSCC zStdio_Va_ListList[] = * content bypass pattern - skip fix if pattern found */ tSCC zStdio_Va_ListBypass0[] = - "__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list"; + "__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list"; #define STDIO_VA_LIST_TEST_CT 1 static tTestDesc aStdio_Va_ListTests[] = { @@ -4177,16 +4188,19 @@ tSCC zStrict_Ansi_NotSelect0[] = */ tSCC zStrict_Ansi_NotBypass0[] = "GNU and MIPS C compilers define __STDC__ differently"; +tSCC zStrict_Ansi_NotBypass1[] = + "__SCO_VERSION__.*__STDC__ != 1"; /* * perform the C function call test */ tSCC zStrict_Ansi_NotFTst0[] = "stdc_0_in_system_headers"; -#define STRICT_ANSI_NOT_TEST_CT 3 +#define STRICT_ANSI_NOT_TEST_CT 4 static tTestDesc aStrict_Ansi_NotTests[] = { { TT_FUNCTION, zStrict_Ansi_NotFTst0, 0 /* unused */ }, { TT_NEGREP, zStrict_Ansi_NotBypass0, (regex_t*)NULL }, + { TT_NEGREP, zStrict_Ansi_NotBypass1, (regex_t*)NULL }, { TT_EGREP, zStrict_Ansi_NotSelect0, (regex_t*)NULL }, }; /* @@ -6004,7 +6018,7 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 164 +#define REGEX_COUNT 168 #define MACH_LIST_SIZE_LIMIT 261 #define FIX_COUNT 152 diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 3aa46c4943d..f3ce2c3d4d2 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -633,12 +633,19 @@ fix = { /* * For C++, avoid any typedef definition of wchar_t, * and use the built in type instead. + * Don't do this for headers that are smart enough to do the right + * thing (recent [n]curses.h and Xlib.h). + * Don't do it for which is never used from C++ anyway, + * and will be broken by the edit. */ fix = { hackname = avoid_wchar_t_type; select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;"; + bypass = "we must use the C\\+\\+ compiler's type"; + bypass = "_LINUX_NLS_H"; + bypass = "XFree86: xc/lib/X11/Xlib\\.h"; c_fix = format; c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; @@ -2277,13 +2284,16 @@ fix = { /* * Don't use or define the name va_list in stdio.h. - * This is for ANSI and also to interoperate properly with gcc's varargs.h. - * Note _BSD_VA_LIST_ is dealt with elsewhere. + * This is for ANSI and also to interoperate properly with gcc's + * varargs.h. Note _BSD_VA_LIST_ is dealt with elsewhere. The + * presence of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken + * to indicate that the header knows what it's doing -- under SUSv2, + * stdio.h is required to define va_list, and we shouldn't break that. */ fix = { hackname = stdio_va_list; files = stdio.h; - bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list'; + bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list'; /* * Use __gnuc_va_list in arg types in place of va_list. @@ -2325,6 +2335,9 @@ fix = { "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)"; /* Tru64 UNIX V4.0F/V5.1 supports GCC usage of __STDC__. */ bypass = 'GNU and MIPS C compilers define __STDC__ differently'; + /* GNU gmp.h uses "__STDC__ != 1" only if __SCO_VERSION__, which + is not defined by GCC, so it is safe. */ + bypass = '__SCO_VERSION__.*__STDC__ != 1'; c_test = stdc_0_in_system_headers; c_fix = format; -- 2.30.2