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
This commit is contained in:
Rainer Orth 2001-05-25 21:36:08 +00:00 committed by Richard Henderson
parent a88072eb43
commit a26c3bb593
5 changed files with 46 additions and 4 deletions

View File

@ -1,3 +1,12 @@
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

View 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 }, };
/*

View 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"

View 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

View 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";