inclhack.def (strict_ansi_not, [...]): Don't run if stdc_0_in_system_headers.
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Fri, 25 May 2001 21:36:08 +0000 (21:36 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 25 May 2001 21:36:08 +0000 (14:36 -0700)
        * fixinc/inclhack.def (strict_ansi_not, strict_ansi_not_ctd,
        strict_ansi_only): Don't run if stdc_0_in_system_headers.
        * fixinc/fixincl.x: Regenerate.
        * fixinc/fixtests.c (stdc_0_in_system_headers_test): New function.
        (FIX_TEST_TABLE): Declare it.
        * fixinc/fixlib.h: Include config.h.

From-SVN: r42593

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/fixlib.h
gcc/fixinc/fixtests.c
gcc/fixinc/inclhack.def

index af4070d..907c45c 100644 (file)
@@ -1,5 +1,14 @@
 2001-05-25  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
+       * fixinc/inclhack.def (strict_ansi_not, strict_ansi_not_ctd,
+       strict_ansi_only): Don't run if stdc_0_in_system_headers.
+       * fixinc/fixincl.x: Regenerate.
+       * fixinc/fixtests.c (stdc_0_in_system_headers_test): New function.
+       (FIX_TEST_TABLE): Declare it.
+       * fixinc/fixlib.h: Include config.h.
+
+2001-05-25  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
        * fixinc/inclhack.def (alpha___assert): Change char * args to
        const char * on Tru64 UNIX to avoid excessive warnings from
        assert.h.
index e0321de..15087ae 100644 (file)
@@ -3700,8 +3700,14 @@ tSCC zStrict_Ansi_NotName[] =
 tSCC zStrict_Ansi_NotSelect0[] =
        "^([ \t]*#[ \t]*if.*)(!__STDC__|__STDC__[ \t]*==[ \t]*0|__STDC__[ \t]*!=[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)(.*)";
 
-#define    STRICT_ANSI_NOT_TEST_CT  1
+/*
+ *  perform the C function call test
+ */
+tSCC zStrict_Ansi_NotFTst0[] = "stdc_0_in_system_headers";
+
+#define    STRICT_ANSI_NOT_TEST_CT  2
 static tTestDesc aStrict_Ansi_NotTests[] = {
+  { TT_FUNCTION, zStrict_Ansi_NotFTst0,   0 /* unused */ },
   { TT_EGREP,    zStrict_Ansi_NotSelect0, (regex_t*)NULL }, };
 
 /*
@@ -3736,8 +3742,14 @@ tSCC zStrict_Ansi_Not_CtdList[] =
 tSCC zStrict_Ansi_Not_CtdSelect0[] =
        "^([ \t]*[|&][|&][ \t(]*)(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)(.*)";
 
-#define    STRICT_ANSI_NOT_CTD_TEST_CT  1
+/*
+ *  perform the C function call test
+ */
+tSCC zStrict_Ansi_Not_CtdFTst0[] = "stdc_0_in_system_headers";
+
+#define    STRICT_ANSI_NOT_CTD_TEST_CT  2
 static tTestDesc aStrict_Ansi_Not_CtdTests[] = {
+  { TT_FUNCTION, zStrict_Ansi_Not_CtdFTst0,   0 /* unused */ },
   { TT_EGREP,    zStrict_Ansi_Not_CtdSelect0, (regex_t*)NULL }, };
 
 /*
@@ -3771,8 +3783,14 @@ tSCC zStrict_Ansi_OnlyName[] =
 tSCC zStrict_Ansi_OnlySelect0[] =
        "^([ \t]*#[ \t]*if.*)(__STDC__[ \t]*!=[ \t]*0|__STDC__[ \t]*==[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0)(.*)";
 
-#define    STRICT_ANSI_ONLY_TEST_CT  1
+/*
+ *  perform the C function call test
+ */
+tSCC zStrict_Ansi_OnlyFTst0[] = "stdc_0_in_system_headers";
+
+#define    STRICT_ANSI_ONLY_TEST_CT  2
 static tTestDesc aStrict_Ansi_OnlyTests[] = {
+  { TT_FUNCTION, zStrict_Ansi_OnlyFTst0,   0 /* unused */ },
   { TT_EGREP,    zStrict_Ansi_OnlySelect0, (regex_t*)NULL }, };
 
 /*
index e53ce35..e42c43d 100644 (file)
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include "auto-host.h"
 #include "ansidecl.h"
+#include "config.h"
 #include "system.h"
 
 #include "gnu-regex.h"
index e3da35b..a2d5faf 100644 (file)
@@ -55,7 +55,8 @@ typedef struct {
 } test_entry_t;
 
 #define FIX_TEST_TABLE \
-  _FT_( "machine_name",     machine_name_test )
+  _FT_( "machine_name",     machine_name_test )        \
+  _FT_( "stdc_0_in_system_headers",    stdc_0_in_system_headers_test )
 
 #define TEST_FOR_FIX_PROC_HEAD( test )          \
 static apply_fix_p_t test PARAMS(( tCC* file, tCC* text ));  \
@@ -116,6 +117,16 @@ TEST_FOR_FIX_PROC_HEAD( machine_name_test )
 }
 
 
+TEST_FOR_FIX_PROC_HEAD( stdc_0_in_system_headers_test )
+{
+#ifdef STDC_0_IN_SYSTEM_HEADERS
+  return SKIP_FIX;
+#else
+  return APPLY_FIX;
+#endif
+}
+
+
 /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 
      test for fix selector
index 07d586c..6c13898 100644 (file)
@@ -1985,6 +1985,7 @@ fix = {
                "|__STDC__[ \t]*!=[ \t]*1"
                "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
                ")(.*)";
+    c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
     c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
@@ -2011,6 +2012,7 @@ fix = {
     select   = "^([ \t]*[|&][|&][ \t(]*)"
                "(__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0"
                ")(.*)";
+    c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
     c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
@@ -2031,6 +2033,7 @@ fix = {
                "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1"
                "|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0"
                ")(.*)";
+    c_test   = stdc_0_in_system_headers;
 
     c_fix     = format;
     c_fix_arg = "%1 defined(__STRICT_ANSI__)%3";