aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc
diff options
context:
space:
mode:
authorBruce Korb <ddsinc09@ix.netcom.com>1999-06-23 12:29:01 +0000
committerBruce Korb <korbb@gcc.gnu.org>1999-06-23 12:29:01 +0000
commitd71ef9d4a69e96ea1a859eb7b535221aaf610c4f (patch)
tree437ab3713d71668a50d618d6a8ee23a7bd9222b7 /gcc/fixinc
parent05dfd09c0cf11e2e19d7e7bfea73cd80d95519dd (diff)
downloadgcc-d71ef9d4a69e96ea1a859eb7b535221aaf610c4f.zip
gcc-d71ef9d4a69e96ea1a859eb7b535221aaf610c4f.tar.gz
gcc-d71ef9d4a69e96ea1a859eb7b535221aaf610c4f.tar.bz2
inclhack.def: Add fix development commentary
1999-06-23 Bruce Korb <ddsinc09@ix.netcom.com> *fixinc/inclhack.def: Add fix development commentary (read_ret_type): reactivate and add selection clause (zzz_*): tweak output file name to match what is used in hackshell.tpl *fixinc/{fixincl.x|inclhack.sh}: regen From-SVN: r27718
Diffstat (limited to 'gcc/fixinc')
-rw-r--r--gcc/fixinc/fixincl.x150
-rw-r--r--gcc/fixinc/inclhack.def92
-rwxr-xr-xgcc/fixinc/inclhack.sh128
3 files changed, 245 insertions, 125 deletions
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index e585852..7acc232 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -5,7 +5,7 @@
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
- * This file contains 104 fixup descriptions.
+ * This file contains 105 fixup descriptions.
*
* See README-fixinc for more information.
*
@@ -2182,7 +2182,42 @@ const char* apzPthread_Page_SizePatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 59 - Rs6000_Double fix
+ * Description 59 - Read_Ret_Type fix
+ */
+tSCC zRead_Ret_TypeName[] =
+ "Read_Ret_Type";
+/*
+ * File name selection pattern
+ */
+tSCC zRead_Ret_TypeList[] =
+ "|stdio.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzRead_Ret_TypeMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zRead_Ret_TypeSelect0[] =
+ "extern int\t.*, fread\\(\\), fwrite\\(\\)";
+
+#define READ_RET_TYPE_TEST_CT 1
+#define READ_RET_TYPE_RE_CT 1
+tTestDesc aRead_Ret_TypeTests[] = {
+ { TT_EGREP, zRead_Ret_TypeSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Read_Ret_Type
+ */
+const char* apzRead_Ret_TypePatch[] = { "sed",
+ "-e", "s/^\\(extern int\tfclose(), fflush()\\), \\(fread(), fwrite()\\)\\(.*\\)$/extern unsigned int\t\\2;\\\n\
+\\1\\3/",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description 60 - Rs6000_Double fix
*/
tSCC zRs6000_DoubleName[] =
"Rs6000_Double";
@@ -2219,7 +2254,7 @@ const char* apzRs6000_DoublePatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 60 - Rs6000_Fchmod fix
+ * Description 61 - Rs6000_Fchmod fix
*/
tSCC zRs6000_FchmodName[] =
"Rs6000_Fchmod";
@@ -2253,7 +2288,7 @@ const char* apzRs6000_FchmodPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 61 - Rs6000_Param fix
+ * Description 62 - Rs6000_Param fix
*/
tSCC zRs6000_ParamName[] =
"Rs6000_Param";
@@ -2279,7 +2314,7 @@ const char* apzRs6000_ParamPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 62 - Sony_Include fix
+ * Description 63 - Sony_Include fix
*/
tSCC zSony_IncludeName[] =
"Sony_Include";
@@ -2313,7 +2348,7 @@ const char* apzSony_IncludePatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 63 - Statsswtch fix
+ * Description 64 - Statsswtch fix
*/
tSCC zStatsswtchName[] =
"Statsswtch";
@@ -2347,7 +2382,7 @@ const char* apzStatsswtchPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 64 - Stdio_Va_List fix
+ * Description 65 - Stdio_Va_List fix
*/
tSCC zStdio_Va_ListName[] =
"Stdio_Va_List";
@@ -2390,7 +2425,7 @@ const char* apzStdio_Va_ListPatch[] = { "sh", "-c",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 65 - Sun_Bogus_Ifdef fix
+ * Description 66 - Sun_Bogus_Ifdef fix
*/
tSCC zSun_Bogus_IfdefName[] =
"Sun_Bogus_Ifdef";
@@ -2424,7 +2459,7 @@ const char* apzSun_Bogus_IfdefPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 66 - Sun_Bogus_Ifdef_Sun4c fix
+ * Description 67 - Sun_Bogus_Ifdef_Sun4c fix
*/
tSCC zSun_Bogus_Ifdef_Sun4cName[] =
"Sun_Bogus_Ifdef_Sun4c";
@@ -2458,7 +2493,7 @@ const char* apzSun_Bogus_Ifdef_Sun4cPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 67 - Sun_Catmacro fix
+ * Description 68 - Sun_Catmacro fix
*/
tSCC zSun_CatmacroName[] =
"Sun_Catmacro";
@@ -2497,7 +2532,7 @@ const char* apzSun_CatmacroPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 68 - Sun_Malloc fix
+ * Description 69 - Sun_Malloc fix
*/
tSCC zSun_MallocName[] =
"Sun_Malloc";
@@ -2526,7 +2561,7 @@ const char* apzSun_MallocPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 69 - Sun_Memcpy fix
+ * Description 70 - Sun_Memcpy fix
*/
tSCC zSun_MemcpyName[] =
"Sun_Memcpy";
@@ -2580,7 +2615,7 @@ extern int memcmp();\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 70 - Sun_Rusers_Semi fix
+ * Description 71 - Sun_Rusers_Semi fix
*/
tSCC zSun_Rusers_SemiName[] =
"Sun_Rusers_Semi";
@@ -2614,7 +2649,7 @@ const char* apzSun_Rusers_SemiPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 71 - Sun_Signal fix
+ * Description 72 - Sun_Signal fix
*/
tSCC zSun_SignalName[] =
"Sun_Signal";
@@ -2653,7 +2688,7 @@ void\t(*signal(...))(...);\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 72 - Sun_Auth_Proto fix
+ * Description 73 - Sun_Auth_Proto fix
*/
tSCC zSun_Auth_ProtoName[] =
"Sun_Auth_Proto";
@@ -2692,7 +2727,7 @@ const char* apzSun_Auth_ProtoPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 73 - Sunos_Matherr_Decl fix
+ * Description 74 - Sunos_Matherr_Decl fix
*/
tSCC zSunos_Matherr_DeclName[] =
"Sunos_Matherr_Decl";
@@ -2720,7 +2755,7 @@ struct exception;\n",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 74 - Sunos_Strlen fix
+ * Description 75 - Sunos_Strlen fix
*/
tSCC zSunos_StrlenName[] =
"Sunos_Strlen";
@@ -2746,7 +2781,7 @@ const char* apzSunos_StrlenPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 75 - Systypes fix
+ * Description 76 - Systypes fix
*/
tSCC zSystypesName[] =
"Systypes";
@@ -2804,7 +2839,7 @@ typedef __SIZE_TYPE__ size_t;\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 76 - Systypes_For_Aix fix
+ * Description 77 - Systypes_For_Aix fix
*/
tSCC zSystypes_For_AixName[] =
"Systypes_For_Aix";
@@ -2849,7 +2884,7 @@ const char* apzSystypes_For_AixPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 77 - Sysv68_String fix
+ * Description 78 - Sysv68_String fix
*/
tSCC zSysv68_StringName[] =
"Sysv68_String";
@@ -2885,7 +2920,7 @@ extern unsigned int\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 78 - Sysz_Stdlib_For_Sun fix
+ * Description 79 - Sysz_Stdlib_For_Sun fix
*/
tSCC zSysz_Stdlib_For_SunName[] =
"Sysz_Stdlib_For_Sun";
@@ -2921,7 +2956,7 @@ const char* apzSysz_Stdlib_For_SunPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 79 - Sysz_Stdtypes_For_Sun fix
+ * Description 80 - Sysz_Stdtypes_For_Sun fix
*/
tSCC zSysz_Stdtypes_For_SunName[] =
"Sysz_Stdtypes_For_Sun";
@@ -2961,7 +2996,7 @@ const char* apzSysz_Stdtypes_For_SunPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 80 - Tinfo_Cplusplus fix
+ * Description 81 - Tinfo_Cplusplus fix
*/
tSCC zTinfo_CplusplusName[] =
"Tinfo_Cplusplus";
@@ -2987,7 +3022,7 @@ const char* apzTinfo_CplusplusPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 81 - Ultrix_Ansi_Compat fix
+ * Description 82 - Ultrix_Ansi_Compat fix
*/
tSCC zUltrix_Ansi_CompatName[] =
"Ultrix_Ansi_Compat";
@@ -3023,7 +3058,7 @@ const char* apzUltrix_Ansi_CompatPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 82 - Ultrix_Fix_Fixproto fix
+ * Description 83 - Ultrix_Fix_Fixproto fix
*/
tSCC zUltrix_Fix_FixprotoName[] =
"Ultrix_Fix_Fixproto";
@@ -3058,7 +3093,7 @@ struct utsname;\n",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 83 - Ultrix_Atof_Param fix
+ * Description 84 - Ultrix_Atof_Param fix
*/
tSCC zUltrix_Atof_ParamName[] =
"Ultrix_Atof_Param";
@@ -3088,7 +3123,7 @@ const char* apzUltrix_Atof_ParamPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 84 - Ultrix_Const fix
+ * Description 85 - Ultrix_Const fix
*/
tSCC zUltrix_ConstName[] =
"Ultrix_Const";
@@ -3122,7 +3157,7 @@ const char* apzUltrix_ConstPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 85 - Ultrix_Ifdef fix
+ * Description 86 - Ultrix_Ifdef fix
*/
tSCC zUltrix_IfdefName[] =
"Ultrix_Ifdef";
@@ -3156,7 +3191,7 @@ const char* apzUltrix_IfdefPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 86 - Ultrix_Nested_Cmnt fix
+ * Description 87 - Ultrix_Nested_Cmnt fix
*/
tSCC zUltrix_Nested_CmntName[] =
"Ultrix_Nested_Cmnt";
@@ -3182,7 +3217,7 @@ const char* apzUltrix_Nested_CmntPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 87 - Ultrix_Static fix
+ * Description 88 - Ultrix_Static fix
*/
tSCC zUltrix_StaticName[] =
"Ultrix_Static";
@@ -3218,7 +3253,7 @@ const char* apzUltrix_StaticPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 88 - Undefine_Null fix
+ * Description 89 - Undefine_Null fix
*/
tSCC zUndefine_NullName[] =
"Undefine_Null";
@@ -3259,7 +3294,7 @@ const char* apzUndefine_NullPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 89 - Va_I960_Macro fix
+ * Description 90 - Va_I960_Macro fix
*/
tSCC zVa_I960_MacroName[] =
"Va_I960_Macro";
@@ -3296,7 +3331,7 @@ const char* apzVa_I960_MacroPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 90 - Void_Null fix
+ * Description 91 - Void_Null fix
*/
tSCC zVoid_NullName[] =
"Void_Null";
@@ -3330,7 +3365,7 @@ const char* apzVoid_NullPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 91 - Vxworks_Gcc_Problem fix
+ * Description 92 - Vxworks_Gcc_Problem fix
*/
tSCC zVxworks_Gcc_ProblemName[] =
"Vxworks_Gcc_Problem";
@@ -3379,7 +3414,7 @@ const char* apzVxworks_Gcc_ProblemPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 92 - Vxworks_Needs_Vxtypes fix
+ * Description 93 - Vxworks_Needs_Vxtypes fix
*/
tSCC zVxworks_Needs_VxtypesName[] =
"Vxworks_Needs_Vxtypes";
@@ -3413,7 +3448,7 @@ const char* apzVxworks_Needs_VxtypesPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 93 - Vxworks_Needs_Vxworks fix
+ * Description 94 - Vxworks_Needs_Vxworks fix
*/
tSCC zVxworks_Needs_VxworksName[] =
"Vxworks_Needs_Vxworks";
@@ -3461,7 +3496,7 @@ const char* apzVxworks_Needs_VxworksPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 94 - Vxworks_Time fix
+ * Description 95 - Vxworks_Time fix
*/
tSCC zVxworks_TimeName[] =
"Vxworks_Time";
@@ -3511,7 +3546,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 95 - X11_Class fix
+ * Description 96 - X11_Class fix
*/
tSCC zX11_ClassName[] =
"X11_Class";
@@ -3550,7 +3585,7 @@ const char* apzX11_ClassPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 96 - X11_Class_Usage fix
+ * Description 97 - X11_Class_Usage fix
*/
tSCC zX11_Class_UsageName[] =
"X11_Class_Usage";
@@ -3584,7 +3619,7 @@ const char* apzX11_Class_UsagePatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 97 - X11_New fix
+ * Description 98 - X11_New fix
*/
tSCC zX11_NewName[] =
"X11_New";
@@ -3624,7 +3659,7 @@ const char* apzX11_NewPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 98 - X11_Sprintf fix
+ * Description 99 - X11_Sprintf fix
*/
tSCC zX11_SprintfName[] =
"X11_Sprintf";
@@ -3652,7 +3687,7 @@ extern char *\tsprintf();\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 99 - Zzz_Ki_Iface fix
+ * Description 100 - Zzz_Ki_Iface fix
*/
tSCC zZzz_Ki_IfaceName[] =
"Zzz_Ki_Iface";
@@ -3682,13 +3717,13 @@ tTestDesc aZzz_Ki_IfaceTests[] = {
*/
const char* apzZzz_Ki_IfacePatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 100 - Zzz_Ki fix
+ * Description 101 - Zzz_Ki fix
*/
tSCC zZzz_KiName[] =
"Zzz_Ki";
@@ -3718,13 +3753,13 @@ tTestDesc aZzz_KiTests[] = {
*/
const char* apzZzz_KiPatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 101 - Zzz_Ki_Calls fix
+ * Description 102 - Zzz_Ki_Calls fix
*/
tSCC zZzz_Ki_CallsName[] =
"Zzz_Ki_Calls";
@@ -3754,13 +3789,13 @@ tTestDesc aZzz_Ki_CallsTests[] = {
*/
const char* apzZzz_Ki_CallsPatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 102 - Zzz_Ki_Defs fix
+ * Description 103 - Zzz_Ki_Defs fix
*/
tSCC zZzz_Ki_DefsName[] =
"Zzz_Ki_Defs";
@@ -3790,13 +3825,13 @@ tTestDesc aZzz_Ki_DefsTests[] = {
*/
const char* apzZzz_Ki_DefsPatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 103 - Zzz_Bad_Fixes fix
+ * Description 104 - Zzz_Bad_Fixes fix
*/
tSCC zZzz_Bad_FixesName[] =
"Zzz_Bad_Fixes";
@@ -3818,13 +3853,13 @@ tSCC zZzz_Bad_FixesList[] =
*/
const char* apzZzz_Bad_FixesPatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description 104 - Zzz_Time fix
+ * Description 105 - Zzz_Time fix
*/
tSCC zZzz_TimeName[] =
"Zzz_Time";
@@ -3854,7 +3889,7 @@ tTestDesc aZzz_TimeTests[] = {
*/
const char* apzZzz_TimePatch[] = { "sh", "-c",
"echo \"Removing incorrect fix to <$file>\" >&2\n\
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n\
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n\
cat > /dev/null",
(char*)NULL };
@@ -3862,8 +3897,8 @@ cat > /dev/null",
*
* List of all fixes
*/
-#define REGEX_COUNT 73
-#define FIX_COUNT 104
+#define REGEX_COUNT 74
+#define FIX_COUNT 105
tFixDesc fixDescList[ FIX_COUNT ] = {
{ zAix_SyswaitName, zAix_SyswaitList,
apzAix_SyswaitMachs, (regex_t*)NULL,
@@ -4155,6 +4190,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
PTHREAD_PAGE_SIZE_TEST_CT, FD_MACH_ONLY,
aPthread_Page_SizeTests, apzPthread_Page_SizePatch },
+ { zRead_Ret_TypeName, zRead_Ret_TypeList,
+ apzRead_Ret_TypeMachs, (regex_t*)NULL,
+ READ_RET_TYPE_TEST_CT, FD_MACH_ONLY,
+ aRead_Ret_TypeTests, apzRead_Ret_TypePatch },
+
{ zRs6000_DoubleName, zRs6000_DoubleList,
apzRs6000_DoubleMachs, (regex_t*)NULL,
RS6000_DOUBLE_TEST_CT, FD_MACH_ONLY,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 94aeb88..58f40fc 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -3,8 +3,67 @@
autogen definitions inclhack;
/*
- * Define all the fixes we know about for repairing damaged headers
- */
+
+Define all the fixes we know about for repairing damaged headers
+
+The rules for making fixes:
+
+1. Every fix must have a "hackname" that is compatible with C syntax
+ for variable names and is unique without regard to alphabetic case.
+
+2. If the problem is known to exist only in certain files,
+ then name each such file with a "files = " entry.
+
+3. It is relatively expensive to fire off a process to fix a source
+ file, therefore write apply tests to avoid unnecessary fix
+ processes. The preferred apply tests are "select" and "bypass"
+ because they are performed internally. "test" sends a command
+ to a server shell that actually fires off one or more processes
+ to do the testing. Avoid it, if you can, but it is still more
+ efficient than a fix process.
+
+ These tests are required to:
+
+ 1. Be positive for all header files that require the fix.
+
+ It is desireable to:
+
+ 2. Be negative as often as possible whenever the fix is not
+ required, avoiding the process overhead.
+
+ It is nice if:
+
+ 3. The expression is as simple as possible to both
+ process and uderstand by people. :-)
+
+ Please take advantage of the fact AutoGen will glue
+ together string fragments. It helps. Also take note
+ that double quote strings and single quote strings have
+ different formation rules. Double quote strings are
+ a tiny superset of C string syntax. Single quote strings
+ follow shell single quote string formation rules, except
+ that the backslash is processed before '\\', '\'' and '#'
+ characters (using C character syntax).
+
+4. There are currently two methods of fixing a file:
+
+ 1. a series of sed expressions. Each will be an individual
+ "-e" argument to a single invocation of sed.
+
+ 2. a shell script. These scripts are _required_ to read all
+ of stdin in order to avoid pipe stalls. They may choose to
+ discard the input.
+
+ A C language subroutine method is planned for both tests and fixes
+ in the near term. Awk ought to be possible too, but there may
+ be portability issues that I am not familiar with.
+
+5. If the fix is to remove the file (i.e. the fixing process broke
+ the file), then you must use a shell script that deletes all
+ copies of the output file and does not write _anything_ to stdout.
+ See the "zzz_*" fixes at the end of this file.
+
+Let the fixes begin: */
/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the definition
@@ -402,15 +461,15 @@ fix = {
files = "sys/stat.h";
sed = "/^static int[ \t]*[a-z]*stat(/i\\\n"
- "#ifdef __cplusplus\\\n"
- "extern \"C\"\\\n"
- "{\\\n"
- "#endif\\\n";
+ "#ifdef __cplusplus\\\n"
+ "extern \"C\"\\\n"
+ "{\\\n"
+ "#endif\\\n";
sed = "/^}$/a\\\n"
- "#ifdef __cplusplus\\\n"
- "}\\\n"
- "#endif \/* __cplusplus *\/\\\n";
+ "#ifdef __cplusplus\\\n"
+ "}\\\n"
+ "#endif \/* __cplusplus *\/\\\n";
};
@@ -1235,15 +1294,14 @@ fix = {
/*
* Fix return type of fread and fwrite on sysV68
*/
-#ifdef LATER
fix = {
hackname = read_ret_type;
files = stdio.h;
+ select = "extern int\t.*, fread\\(\\), fwrite\\(\\)";
sed = "s/^\\(extern int\tfclose(), fflush()\\), "
"\\(fread(), fwrite()\\)\\(.*\\)$"
"/extern unsigned int\t\\2;\\\n\\1\\3/";
};
-#endif
/*
@@ -2386,7 +2444,7 @@ fix = {
select = 'These definitions are for HP Internal developers';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
@@ -2400,7 +2458,7 @@ fix = {
select = '11.00 HP-UX LP64';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
@@ -2414,7 +2472,7 @@ fix = {
select = 'kthread_create_caller_t';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
@@ -2428,7 +2486,7 @@ fix = {
select = 'Kernel Instrumentation Definitions';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
@@ -2445,7 +2503,7 @@ fix = {
/* shouldn't there be a select expression here??? */
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
@@ -2459,7 +2517,7 @@ fix = {
select = '11.0 and later representation of ki time';
shell =
"echo \"Removing incorrect fix to <$file>\" >&2\n"
- "rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp\n"
+ "rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp\n"
"cat > /dev/null";
};
diff --git a/gcc/fixinc/inclhack.sh b/gcc/fixinc/inclhack.sh
index 41abc8f..02131d3 100755
--- a/gcc/fixinc/inclhack.sh
+++ b/gcc/fixinc/inclhack.sh
@@ -6,7 +6,7 @@
# files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search.
#
-# This script contains 104 fixup scripts.
+# This script contains 105 fixup scripts.
#
# See README-fixinc for more information.
#
@@ -1895,7 +1895,29 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 59: Rs6000_Double
+ # Fix 59: Read_Ret_Type
+ #
+ case "${file}" in ./stdio.h )
+ if ( test -n "`egrep 'extern int .*, fread\\(\\), fwrite\\(\\)' ${file}`"
+ ) > /dev/null 2>&1 ; then
+ fixlist="${fixlist}
+ read_ret_type"
+ if [ ! -r ${DESTFILE} ]
+ then infile=${file}
+ else infile=${DESTFILE} ; fi
+
+ sed -e 's/^\(extern int fclose(), fflush()\), \(fread(), fwrite()\)\(.*\)$/extern unsigned int \2;\
+\1\3/' \
+ < $infile > ${DESTDIR}/fixinc.tmp
+ rm -f ${DESTFILE}
+ mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
+ fi # end of selection 'if'
+ ;; # case end for file name test
+ esac
+
+
+ #
+ # Fix 60: Rs6000_Double
#
case "${file}" in ./math.h )
if ( test -n "`egrep '[^a-zA-Z_]class\\(' ${file}`"
@@ -1921,7 +1943,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 60: Rs6000_Fchmod
+ # Fix 61: Rs6000_Fchmod
#
case "${file}" in ./sys/stat.h )
if ( test -n "`egrep 'fchmod\\(char' ${file}`"
@@ -1942,7 +1964,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 61: Rs6000_Param
+ # Fix 62: Rs6000_Param
#
case "${file}" in ./stdio.h | \
./unistd.h )
@@ -1961,7 +1983,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 62: Sony_Include
+ # Fix 63: Sony_Include
#
case "${file}" in ./machine/machparam.h )
if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' ${file}`"
@@ -1982,7 +2004,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 63: Statsswtch
+ # Fix 64: Statsswtch
#
case "${file}" in ./rpcsvc/rstat.h )
if ( test -n "`egrep 'boottime$' ${file}`"
@@ -2003,7 +2025,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 64: Stdio_Va_List
+ # Fix 65: Stdio_Va_List
#
case "${file}" in ./stdio.h )
fixlist="${fixlist}
@@ -2042,7 +2064,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 65: Sun_Bogus_Ifdef
+ # Fix 66: Sun_Bogus_Ifdef
#
case "${file}" in ./hsfs/hsfs_spec.h | \
./hsfs/iso_spec.h )
@@ -2064,7 +2086,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 66: Sun_Bogus_Ifdef_Sun4c
+ # Fix 67: Sun_Bogus_Ifdef_Sun4c
#
case "${file}" in ./hsfs/hsnode.h )
if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' ${file}`"
@@ -2085,7 +2107,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 67: Sun_Catmacro
+ # Fix 68: Sun_Catmacro
#
case "${file}" in ./pixrect/memvar.h )
if ( test -n "`egrep '^#define[ ]+CAT\\(a,b\\)' ${file}`"
@@ -2113,7 +2135,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 68: Sun_Malloc
+ # Fix 69: Sun_Malloc
#
case "${file}" in ./malloc.h )
fixlist="${fixlist}
@@ -2134,7 +2156,7 @@ typedef __regmatch_t regmatch_t;
#
- # Fix 69: Sun_Memcpy
+ # Fix 70: Sun_Memcpy
#
case "${file}" in ./memory.h )
if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`"
@@ -2176,7 +2198,7 @@ extern int memcmp();\
#
- # Fix 70: Sun_Rusers_Semi
+ # Fix 71: Sun_Rusers_Semi
#
case "${file}" in ./rpcsvc/rusers.h )
if ( test -n "`egrep '_cnt$' ${file}`"
@@ -2197,7 +2219,7 @@ extern int memcmp();\
#
- # Fix 71: Sun_Signal
+ # Fix 72: Sun_Signal
#
case "${file}" in ./sys/signal.h | \
./signal.h )
@@ -2226,7 +2248,7 @@ void (*signal(...))(...);\
#
- # Fix 72: Sun_Auth_Proto
+ # Fix 73: Sun_Auth_Proto
#
case "${file}" in ./rpc/auth.h | \
./rpc/clnt.h | \
@@ -2255,7 +2277,7 @@ void (*signal(...))(...);\
#
- # Fix 73: Sunos_Matherr_Decl
+ # Fix 74: Sunos_Matherr_Decl
#
case "${file}" in ./math.h )
fixlist="${fixlist}
@@ -2276,7 +2298,7 @@ struct exception;
#
- # Fix 74: Sunos_Strlen
+ # Fix 75: Sunos_Strlen
#
case "${file}" in ./strings.h )
fixlist="${fixlist}
@@ -2294,7 +2316,7 @@ struct exception;
#
- # Fix 75: Systypes
+ # Fix 76: Systypes
#
case "${file}" in ./sys/types.h | \
./stdlib.h | \
@@ -2348,7 +2370,7 @@ typedef __SIZE_TYPE__ size_t;\
#
- # Fix 76: Systypes_For_Aix
+ # Fix 77: Systypes_For_Aix
#
case "${file}" in ./sys/types.h )
if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`" -a \
@@ -2376,7 +2398,7 @@ typedef __SIZE_TYPE__ size_t;\
#
- # Fix 77: Sysv68_String
+ # Fix 78: Sysv68_String
#
case "${file}" in ./string.h )
fixlist="${fixlist}
@@ -2404,7 +2426,7 @@ extern unsigned int\
#
- # Fix 78: Sysz_Stdlib_For_Sun
+ # Fix 79: Sysz_Stdlib_For_Sun
#
case "${file}" in ./stdlib.h )
fixlist="${fixlist}
@@ -2434,7 +2456,7 @@ extern unsigned int\
#
- # Fix 79: Sysz_Stdtypes_For_Sun
+ # Fix 80: Sysz_Stdtypes_For_Sun
#
case "${file}" in ./sys/stdtypes.h )
fixlist="${fixlist}
@@ -2472,7 +2494,7 @@ extern unsigned int\
#
- # Fix 80: Tinfo_Cplusplus
+ # Fix 81: Tinfo_Cplusplus
#
case "${file}" in ./tinfo.h )
fixlist="${fixlist}
@@ -2490,7 +2512,7 @@ extern unsigned int\
#
- # Fix 81: Ultrix_Ansi_Compat
+ # Fix 82: Ultrix_Ansi_Compat
#
case "${file}" in ./ansi_compat.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
@@ -2514,7 +2536,7 @@ extern unsigned int\
#
- # Fix 82: Ultrix_Fix_Fixproto
+ # Fix 83: Ultrix_Fix_Fixproto
#
case "${file}" in ./sys/utsname.h )
if ( test -n "`egrep 'ULTRIX' ${file}`"
@@ -2537,7 +2559,7 @@ struct utsname;
#
- # Fix 83: Ultrix_Atof_Param
+ # Fix 84: Ultrix_Atof_Param
#
case "${file}" in ./math.h )
fixlist="${fixlist}
@@ -2559,7 +2581,7 @@ struct utsname;
#
- # Fix 84: Ultrix_Const
+ # Fix 85: Ultrix_Const
#
case "${file}" in ./stdio.h )
fixlist="${fixlist}
@@ -2585,7 +2607,7 @@ struct utsname;
#
- # Fix 85: Ultrix_Ifdef
+ # Fix 86: Ultrix_Ifdef
#
case "${file}" in ./sys/file.h )
if ( test -n "`egrep '#ifdef KERNEL' ${file}`"
@@ -2606,7 +2628,7 @@ struct utsname;
#
- # Fix 86: Ultrix_Nested_Cmnt
+ # Fix 87: Ultrix_Nested_Cmnt
#
case "${file}" in ./rpc/svc.h )
fixlist="${fixlist}
@@ -2624,7 +2646,7 @@ struct utsname;
#
- # Fix 87: Ultrix_Static
+ # Fix 88: Ultrix_Static
#
case "${file}" in ./machine/cpu.h )
if ( test -n "`egrep '#include \"r[34]_cpu' ${file}`"
@@ -2647,7 +2669,7 @@ struct utsname;
#
- # Fix 88: Undefine_Null
+ # Fix 89: Undefine_Null
#
if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ ]' ${file}`" -a \
-z "`egrep '#[ ]*(ifn|un)def[ ]*[ ]NULL($|[ ])' ${file}`"
@@ -2668,7 +2690,7 @@ struct utsname;
#
- # Fix 89: Va_I960_Macro
+ # Fix 90: Va_I960_Macro
#
case "${file}" in ./arch/i960/archI960.h )
if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' ${file}`"
@@ -2692,7 +2714,7 @@ struct utsname;
#
- # Fix 90: Void_Null
+ # Fix 91: Void_Null
#
case "${file}" in ./curses.h | \
./dbm.h | \
@@ -2723,7 +2745,7 @@ struct utsname;
#
- # Fix 91: Vxworks_Gcc_Problem
+ # Fix 92: Vxworks_Gcc_Problem
#
case "${file}" in ./types/vxTypesBase.h )
if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' ${file}`"
@@ -2765,7 +2787,7 @@ struct utsname;
#
- # Fix 92: Vxworks_Needs_Vxtypes
+ # Fix 93: Vxworks_Needs_Vxtypes
#
case "${file}" in ./time.h )
if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' ${file}`"
@@ -2786,7 +2808,7 @@ struct utsname;
#
- # Fix 93: Vxworks_Needs_Vxworks
+ # Fix 94: Vxworks_Needs_Vxworks
#
case "${file}" in ./sys/stat.h )
if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' ${file}`" -a \
@@ -2812,7 +2834,7 @@ struct utsname;
#
- # Fix 94: Vxworks_Time
+ # Fix 95: Vxworks_Time
#
case "${file}" in ./time.h )
if ( test -n "`egrep 'VOIDFUNCPTR' ${file}`" -a \
@@ -2844,7 +2866,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
#
- # Fix 95: X11_Class
+ # Fix 96: X11_Class
#
case "${file}" in ./X11/ShellP.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
@@ -2872,7 +2894,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
#
- # Fix 96: X11_Class_Usage
+ # Fix 97: X11_Class_Usage
#
case "${file}" in ./Xm/BaseClassI.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
@@ -2893,7 +2915,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
#
- # Fix 97: X11_New
+ # Fix 98: X11_New
#
case "${file}" in ./Xm/Traversal.h )
if ( test -z "`egrep '__cplusplus' ${file}`"
@@ -2922,7 +2944,7 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\
#
- # Fix 98: X11_Sprintf
+ # Fix 99: X11_Sprintf
#
case "${file}" in ./X11*/Xmu.h )
fixlist="${fixlist}
@@ -2942,7 +2964,7 @@ extern char * sprintf();\
#
- # Fix 99: Zzz_Ki_Iface
+ # Fix 100: Zzz_Ki_Iface
#
case "${file}" in ./sys/ki_iface.h )
if ( test -n "`egrep 'These definitions are for HP Internal developers' ${file}`"
@@ -2953,7 +2975,7 @@ extern char * sprintf();\
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
@@ -2969,7 +2991,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
#
- # Fix 100: Zzz_Ki
+ # Fix 101: Zzz_Ki
#
case "${file}" in ./sys/ki.h )
if ( test -n "`egrep '11.00 HP-UX LP64' ${file}`"
@@ -2980,7 +3002,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
@@ -2996,7 +3018,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
#
- # Fix 101: Zzz_Ki_Calls
+ # Fix 102: Zzz_Ki_Calls
#
case "${file}" in ./sys/ki_calls.h )
if ( test -n "`egrep 'kthread_create_caller_t' ${file}`"
@@ -3007,7 +3029,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
@@ -3023,7 +3045,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
#
- # Fix 102: Zzz_Ki_Defs
+ # Fix 103: Zzz_Ki_Defs
#
case "${file}" in ./sys/ki_defs.h )
if ( test -n "`egrep 'Kernel Instrumentation Definitions' ${file}`"
@@ -3034,7 +3056,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
@@ -3050,7 +3072,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
#
- # Fix 103: Zzz_Bad_Fixes
+ # Fix 104: Zzz_Bad_Fixes
#
case "${file}" in ./sundev/ipi_error.h )
fixlist="${fixlist}
@@ -3059,7 +3081,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output
@@ -3074,7 +3096,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
#
- # Fix 104: Zzz_Time
+ # Fix 105: Zzz_Time
#
case "${file}" in ./sys/time.h )
if ( test -n "`egrep '11.0 and later representation of ki time' ${file}`"
@@ -3085,7 +3107,7 @@ cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
then infile=${file}
else infile=${DESTFILE} ; fi
( echo "Removing incorrect fix to <$file>" >&2
-rm -f ${DESTDIR}/$file ${DESTDIR}/fixinc.tmp
+rm -f ${DESTFILE} ${DESTDIR}/fixinc.tmp
cat > /dev/null ) < $infile > ${DESTDIR}/fixinc.tmp
# Shell scripts have the potential of removing the output