aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>2001-05-25 21:36:08 +0000
committerRichard Henderson <rth@gcc.gnu.org>2001-05-25 14:36:08 -0700
commita26c3bb59317a6518c2b9b3854bc664657f36216 (patch)
treeb1a2c30c2a7aded201df738360daeab353748b35
parenta88072eb43e3fdaba206d8685782ebad4743f641 (diff)
downloadgcc-a26c3bb59317a6518c2b9b3854bc664657f36216.zip
gcc-a26c3bb59317a6518c2b9b3854bc664657f36216.tar.gz
gcc-a26c3bb59317a6518c2b9b3854bc664657f36216.tar.bz2
inclhack.def (strict_ansi_not, [...]): Don't run if stdc_0_in_system_headers.
* 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
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/fixinc/fixincl.x24
-rw-r--r--gcc/fixinc/fixlib.h1
-rw-r--r--gcc/fixinc/fixtests.c13
-rw-r--r--gcc/fixinc/inclhack.def3
5 files changed, 46 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index af4070d..907c45c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index e0321de..15087ae 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -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 }, };
/*
diff --git a/gcc/fixinc/fixlib.h b/gcc/fixinc/fixlib.h
index e53ce35..e42c43d 100644
--- a/gcc/fixinc/fixlib.h
+++ b/gcc/fixinc/fixlib.h
@@ -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"
diff --git a/gcc/fixinc/fixtests.c b/gcc/fixinc/fixtests.c
index e3da35b..a2d5faf 100644
--- a/gcc/fixinc/fixtests.c
+++ b/gcc/fixinc/fixtests.c
@@ -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
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 07d586c..6c13898 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -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";