re PR other/2873 ([3.3 only][fixinclude] Bogus fixinclude of stdio.h from glibc 2...
authorZack Weinberg <zack@gcc.gnu.org>
Thu, 22 May 2003 17:03:57 +0000 (17:03 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Thu, 22 May 2003 17:03:57 +0000 (17:03 +0000)
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
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def

index 9696910053d60d9a2042632dc79c38a2054886eb..672b54bc5b5026e267bb7faab90ad0135d142a85 100644 (file)
@@ -1,7 +1,17 @@
+2003-05-22  Zack Weinberg  <zack@codesourcery.com>
+
+       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 <rekhad@kpitcummins.com>
 
        * 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  <ebotcazou@libertysurf.fr>
 
 2003-05-19  Seth Arnold  <sarnold@wirex.com>
            Aldy Hernandez  <aldyh@redhat.com>
 
-        * 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  <aldyh@redhat.com>
 
-        * doc/tm.texi (function_arg): Fix typo.
+       * doc/tm.texi (function_arg): Fix typo.
 
 2003-05-19  Matt Austern  <austern@apple.com>
 
        * 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  <kevin.hendricks@sympatico.ca>
-            David Edelsohn  <edelsohn@gnu.org>
+           David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.c (rs6000_alignment_string,
        rs6000_alignment_flags): New variables.
index c3155940b08648c57e21aa7b436423d4672fa5cc..84239e70a1e16bf47610cfe179b67159ece182ac 100644 (file)
@@ -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 <stdarg.h>\\n\"\n\
                \"#else\\n\"\n\
                \"#include <varargs.h>\\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
 
index 3aa46c4943dbac4ba83e852273167a69d31a2f36..f3ce2c3d4d2ab7b0f07228fdbdc3028eb49e569d 100644 (file)
@@ -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 <linux/nls.h> 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 <standards.h> 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;