diff options
author | Nathanael Nerode <neroden@gcc.gnu.org> | 2003-08-04 19:30:11 +0000 |
---|---|---|
committer | Nathanael Nerode <neroden@gcc.gnu.org> | 2003-08-04 19:30:11 +0000 |
commit | 76d2e2c547be369f04a192181df7f0a8d79cd270 (patch) | |
tree | 7d3d4ab38382944454f09661ff4af8d30cb78402 /gcc/fixinc | |
parent | 0e0464535ed47016fb22a3fc5a75a517545fb737 (diff) | |
download | gcc-76d2e2c547be369f04a192181df7f0a8d79cd270.zip gcc-76d2e2c547be369f04a192181df7f0a8d79cd270.tar.gz gcc-76d2e2c547be369f04a192181df7f0a8d79cd270.tar.bz2 |
inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
* fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
* fixinc/inclhack.def (static_getrnge): Remove disabled hack.
* fixinc/fixincl.x: Rebuild.
* fixinc/tests/base/regexp.h: New test.
From-SVN: r70153
Diffstat (limited to 'gcc/fixinc')
-rw-r--r-- | gcc/fixinc/fixincl.x | 60 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.def | 48 | ||||
-rw-r--r-- | gcc/fixinc/tests/base/regexp.h | 18 |
3 files changed, 102 insertions, 24 deletions
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 5522a55..46741b9 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 Friday August 1, 2003 at 06:47:22 PM EDT + * It has been AutoGen-ed Monday August 4, 2003 at 03:26:31 PM EDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Aug 1 18:47:22 EDT 2003 +/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Aug 4 15:26:31 EDT 2003 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 155 fixup descriptions. + * This file contains 156 fixup descriptions. * * See README for more information. * @@ -4939,6 +4939,50 @@ static const char* apzSvr4_ProfilPatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Svr4_Undeclared_Getrnge fix + */ +tSCC zSvr4_Undeclared_GetrngeName[] = + "svr4_undeclared_getrnge"; + +/* + * File name selection pattern + */ +tSCC zSvr4_Undeclared_GetrngeList[] = + "|regexp.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSvr4_Undeclared_GetrngeMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSvr4_Undeclared_GetrngeSelect0[] = + "getrnge"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSvr4_Undeclared_GetrngeBypass0[] = + "static void getrnge"; + +#define SVR4_UNDECLARED_GETRNGE_TEST_CT 2 +static tTestDesc aSvr4_Undeclared_GetrngeTests[] = { + { TT_NEGREP, zSvr4_Undeclared_GetrngeBypass0, (regex_t*)NULL }, + { TT_EGREP, zSvr4_Undeclared_GetrngeSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Svr4_Undeclared_Getrnge + */ +static const char* apzSvr4_Undeclared_GetrngePatch[] = { + "format", + "%0\n\ +static int getrnge ();", + "^static int[ \t]+size;", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Sysv68_String fix */ tSCC zSysv68_StringName[] = @@ -6149,9 +6193,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 174 +#define REGEX_COUNT 176 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 155 +#define FIX_COUNT 156 /* * Enumerate the fixes @@ -6280,6 +6324,7 @@ typedef enum { SVR4_DISABLE_OPT_FIXIDX, SVR4_GETCWD_FIXIDX, SVR4_PROFIL_FIXIDX, + SVR4_UNDECLARED_GETRNGE_FIXIDX, SYSV68_STRING_FIXIDX, SYSZ_STDLIB_FOR_SUN_FIXIDX, THREAD_KEYWORD_FIXIDX, @@ -6930,6 +6975,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSvr4_ProfilTests, apzSvr4_ProfilPatch, 0 }, + { zSvr4_Undeclared_GetrngeName, zSvr4_Undeclared_GetrngeList, + apzSvr4_Undeclared_GetrngeMachs, + SVR4_UNDECLARED_GETRNGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSvr4_Undeclared_GetrngeTests, apzSvr4_Undeclared_GetrngePatch, 0 }, + { zSysv68_StringName, zSysv68_StringList, apzSysv68_StringMachs, SYSV68_STRING_TEST_CT, FD_MACH_ONLY, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 7c5922b..c342f92 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2305,25 +2305,6 @@ fix = { /* - * Add a `static' declaration of `getrnge' into <regexp.h>. - * - * Don't do this if there is already a `static void getrnge' declaration - * present, since this would cause a redeclaration error. Solaris 2.x has - * such a declaration. - */ -#ifdef SVR4 -fix = { - hackname = static_getrnge; - files = regexp.h; - bypass = "static void getrnge"; - sed = "/^static int[ \t]*size;/c\\\n" - "static int size ;\\\n\\\n" - "static int getrnge ();"; -}; -#endif - - -/* * a missing semi-colon at the end of the statsswtch structure definition. */ fix = { @@ -2990,6 +2971,35 @@ fix = { /* + * Some SysV r4 systems, including Sequent's DYNIX/ptx, use the local + * function 'getrnge' in <regexp.h> before they declare it. For these + * systems add a 'static int' declaration of 'getrnge' into <regexp.h> + * early on. + * + * 'getrnge' traditionally manipulates a file-scope global called 'size', + * so put the declaration right after the declaration of 'size'. + * + * Don't do this if there is already a `static void getrnge' declaration + * present, since this would cause a redeclaration error. Solaris 2.x has + * such a declaration. + */ +fix = { + hackname = svr4_undeclared_getrnge; + files = regexp.h; + select = "getrnge"; + bypass = "static void getrnge"; + c_fix = format; + c_fix_arg = "%0\n" + "static int getrnge ();"; + c_fix_arg = "^static int[ \t]+size;"; + test_text = "static int size;\n" + "/* stuff which calls getrnge() */\n" + "static getrnge()\n" + "{}"; +}; + + +/* * Like svr4_mach_defines, but with newfangled syntax. * Source lines are of #define __i386 #machine(i386). Delete them. */ diff --git a/gcc/fixinc/tests/base/regexp.h b/gcc/fixinc/tests/base/regexp.h new file mode 100644 index 0000000..35ec049 --- /dev/null +++ b/gcc/fixinc/tests/base/regexp.h @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/regexp.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( SVR4_UNDECLARED_GETRNGE_CHECK ) +static int size; +static int getrnge (); +/* stuff which calls getrnge() */ +static getrnge() +{} +#endif /* SVR4_UNDECLARED_GETRNGE_CHECK */ |