This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fixinc "make check" now uses directory tree
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Subject: fixinc "make check" now uses directory tree
- From: Bruce Korb <bkorb at sco dot COM>
- Date: Wed, 31 May 2000 07:50:09 -0700
- Organization: Santa Cruz Operations
This patch changes the fixinc "make check" facility to use an
expected output tree instead of a diff of diffs file.
I also added several new check tests.
2000-05-31 Bruce Korb <bkorb@gnu.org>
* check.tpl: rework to use test result tree
* check.diff: No longer needed
* fixincl.x: regenerate
* inclhack.def: add new tests
* tests/base/arch/i960/archI960.h: New test result
* tests/base/curses.h: modified test result
* tests/base/stdio.h: ditto
* tests/base/time.h: ditto
* tests/base/sys/asm.h: ditto
* tests/base/sys/stat.h: ditto
* tests/base/sys/wait.h: ditto
Index: check.tpl
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/check.tpl,v
retrieving revision 1.5
retrieving revision 1.7
diff -u -r1.5 -r1.7
--- check.tpl 2000/05/19 14:15:13 1.5
+++ check.tpl 2000/05/31 14:44:35 1.7
@@ -6,10 +6,13 @@
=]#!/bin/sh
set -e
-[ -d testdir ] && rm -rf testdir
-mkdir testdir
-cd testdir
+TESTDIR=tests
+TESTBASE=`cd $1;pwd`
+[ -d ${TESTDIR} ] || mkdir ${TESTDIR}
+cd ${TESTDIR}
+TESTDIR=`pwd`
+
TARGET_MACHINE='*'
DESTDIR=`pwd`/res
SRCDIR=`pwd`/inc
@@ -18,6 +21,7 @@
export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE
+rm -rf ${DESTDIR} ${SRCDIR}
mkdir ${DESTDIR} ${SRCDIR}
( cd ${SRCDIR}
@@ -37,10 +41,41 @@
mkdir $f || mkdir -p $f
done ) > /dev/null 2>&1
+cd inc
[=
_FOR fix =][=
+ _IF test_text _count 1 > =]
+#
+# [=hackname=] has [=_EVAL test_text _count=] tests
+#
+sfile=[=
+ _IF files _exist =][=
+ files[0] =][=
+ _ELSE =]testing.h[=
+ _ENDIF =]
+dfile=`dirname $sfile`/[=hackname "_A-Z" "-a-z" _tr=]-[=_EVAL _index=].h
+fixnum=[=_EVAL _index=][=
+ _FOR test_text FROM 1 =]
+cat >> $sfile <<_HACK_EOF_
+
+
+#if defined( [=hackname _up=]_CHECK_[=_EVAL _index=] )
+[=test_text=]
+#endif /* [=hackname _up=]_CHECK_[=_EVAL _index=] */
+_HACK_EOF_
+echo $sfile | ../../fixincl
+[ -f ${DESTDIR}/$sfile ] && mv ${DESTDIR}/$sfile ${DESTDIR}/$dfile[=
+ /test_text =][=
+ _ENDIF =][=
+
+/fix
+
+=][=
+
+_FOR fix =][=
+
_IF test_text _exist ! =][=
_IF replace _exist ! =]
echo No test for [=hackname=] in inc/[=
@@ -50,16 +85,16 @@
_ENDIF =][=
_ENDIF =][=
_ELSE =]
-cat >> inc/[=
+cat >> [=
_IF files _exist =][=
files[0] =][=
_ELSE =]testing.h[=
- _ENDIF =] <<- _HACK_EOF_
+ _ENDIF =] <<_HACK_EOF_
- #if defined( [=hackname _up=]_CHECK )
-[=test_text "\t" _prefix=]
- #endif /* [=hackname _up=]_CHECK */
+#if defined( [=hackname _up=]_CHECK )
+[=test_text=]
+#endif /* [=hackname _up=]_CHECK */
_HACK_EOF_
[=_ENDIF =][=
@@ -67,40 +102,63 @@
=]
-cd inc
-find . -type f | sed 's;\./;;' | sort > ../LIST
-../../fixincl < ../LIST
-cd ..
+find . -type f | sed 's;\./;;' | sort | ../../fixincl
+cd ${DESTDIR}
+
+exitok=true
+
+find * -type f -print > ${TESTDIR}/LIST
+exitok=`
+exec < ${TESTDIR}/LIST
while read f
do
- if [ ! -f res/$f ]
+ if [ ! -f ${TESTBASE}/$f ]
then
- echo "Only in inc: inc/$f"
+ echo "Newly fixed header: $f" >&2
+ exitok=false
+
+ elif cmp $f ${TESTBASE}/$f >&2
+ then
+ :
+
else
- diff -c inc/$f res/$f | \
- sed -e '1,2s; .*;;' -e '/MACH_DIFF:/,/no uniform test,/d'
+ diff -c $f ${TESTBASE}/$f >&2 || :
+ exitok=false
fi
-done > NEWDIFF < LIST
+done
+echo $exitok`
-echo
-echo Test output check:
-[=
+cd $TESTBASE
-_FOR fix =][=
+find * -type f -print | \
+fgrep -v 'CVS/' > ${TESTDIR}/LIST
- _IF test_text _exist =]
-fgrep [=hackname _up=]_CHECK NEWDIFF > /dev/null 2>&1 || \
- echo "[=_eval hackname _get "#%32s test failed. See testdir/inc/"
- _printf =][=
- _IF files _exist =][=
- files[0] =][=
- _ELSE =]testing.h[=
- _ENDIF =]"[=
- _ENDIF =][=
+exitok=`
+exec < ${TESTDIR}/LIST
+while read f
+do
+ if [ -s $f ] && [ ! -f ${DESTDIR}/$f ]
+ then
+ echo "Missing header fix: $f" >&2
+ exitok=false
+ fi
+done
+echo $exitok`
-/fix
+echo
+if $exitok
+then
+ cd ${TESTDIR}
+ rm -rf inc res LIST
+ cd ..
+ rmdir ${TESTDIR} > /dev/null 2>&1 || :
+ echo All fixinclude tests pass >&2
+else
+ echo There were fixinclude test FAILURES >&2
+fi
+$exitok[=
-=][=
_eval _outfile "chmod +x %s" _printf _shell
+
=]
Index: fixincl.x
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/fixincl.x,v
retrieving revision 1.73
diff -u -r1.73 fixincl.x
--- fixincl.x 2000/05/30 20:55:50 1.73
+++ fixincl.x 2000/05/31 14:22:19
@@ -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 122 fixup descriptions.
+ * This file contains 123 fixup descriptions.
*
* See README-fixinc for more information.
*
@@ -4253,8 +4253,9 @@
/*
* Fix Command Arguments for Tinfo_Cplusplus
*/
-const char* apzTinfo_CplusplusPatch[] = { "sed",
- "-e", "s/[ \t]_cplusplus/ __cplusplus/",
+const char* apzTinfo_CplusplusPatch[] = {
+ "format",
+ " __cplusplus",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -4309,29 +4310,68 @@
* Machine/OS name selection pattern
*/
#define apzUltrix_ConstMachs (const char**)NULL
-#define ULTRIX_CONST_TEST_CT 0
-#define aUltrix_ConstTests (tTestDesc*)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zUltrix_ConstSelect0[] =
+ "perror\\( char \\*";
+
+#define ULTRIX_CONST_TEST_CT 1
+tTestDesc aUltrix_ConstTests[] = {
+ { TT_EGREP, zUltrix_ConstSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Ultrix_Const
*/
-const char* apzUltrix_ConstPatch[] = { "sed",
- "-e", "s@perror( char \\*__s );@perror( const char *__s );@",
- "-e", "s@fputs( char \\*__s,@fputs( const char *__s,@",
- "-e", "s@fopen( char \\*__filename, char \\*__type );@fopen( const char *__filename, const char *__type );@",
- "-e", "s@fwrite( void \\*__ptr,@fwrite( const void *__ptr,@",
- "-e", "s@fscanf( FILE \\*__stream, char \\*__format,@fscanf( FILE *__stream, const char *__format,@",
- "-e", "s@scanf( char \\*__format,@scanf( const char *__format,@",
- "-e", "s@sscanf( char \\*__s, char \\*__format,@sscanf( const char *__s, const char *__format,@",
- "-e", "s@popen(char \\*, char \\*);@popen(const char *, const char *);@",
- "-e", "s@tempnam(char\\*,char\\*);@tempnam(const char*,const char*);@",
+const char* apzUltrix_ConstPatch[] = {
+ "format",
+ "%1 const %3 *__",
+ "([ \t*](perror|fputs|fwrite|scanf|fscanf)\\(.*)[ \t]+(char|void) \\*__",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Ultrix_Const2 fix
+ */
+#define ULTRIX_CONST2_FIXIDX 107
+tSCC zUltrix_Const2Name[] =
+ "ultrix_const2";
+
+/*
+ * File name selection pattern
+ */
+tSCC zUltrix_Const2List[] =
+ "|stdio.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzUltrix_Const2Machs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zUltrix_Const2Select0[] =
+ "\\*fopen\\( char \\*";
+
+#define ULTRIX_CONST2_TEST_CT 1
+tTestDesc aUltrix_Const2Tests[] = {
+ { TT_EGREP, zUltrix_Const2Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Ultrix_Const2
+ */
+const char* apzUltrix_Const2Patch[] = {
+ "format",
+ "%1( const char *%3, const char *",
+ "([ \t*](fopen|sscanf|popen|tempnam))\\([ \t]*char[ \t]*\\*([^,]*),[ \t]*char[ \t]*\\*[ \t]*",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Ultrix_Fix_Fixproto fix
*/
-#define ULTRIX_FIX_FIXPROTO_FIXIDX 107
+#define ULTRIX_FIX_FIXPROTO_FIXIDX 108
tSCC zUltrix_Fix_FixprotoName[] =
"ultrix_fix_fixproto";
@@ -4367,7 +4407,7 @@
*
* Description of Ultrix_Ifdef fix
*/
-#define ULTRIX_IFDEF_FIXIDX 108
+#define ULTRIX_IFDEF_FIXIDX 109
tSCC zUltrix_IfdefName[] =
"ultrix_ifdef";
@@ -4385,7 +4425,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zUltrix_IfdefSelect0[] =
- "#ifdef KERNEL[ \t]*[^ \t]";
+ "#ifdef KERNEL[ \t]+[^ \t]";
#define ULTRIX_IFDEF_TEST_CT 1
tTestDesc aUltrix_IfdefTests[] = {
@@ -4402,7 +4442,7 @@
*
* Description of Ultrix_Static fix
*/
-#define ULTRIX_STATIC_FIXIDX 109
+#define ULTRIX_STATIC_FIXIDX 110
tSCC zUltrix_StaticName[] =
"ultrix_static";
@@ -4439,7 +4479,7 @@
*
* Description of Undefine_Null fix
*/
-#define UNDEFINE_NULL_FIXIDX 110
+#define UNDEFINE_NULL_FIXIDX 111
tSCC zUndefine_NullName[] =
"undefine_null";
@@ -4485,7 +4525,7 @@
*
* Description of Unixware7_Byteorder_Fix fix
*/
-#define UNIXWARE7_BYTEORDER_FIX_FIXIDX 111
+#define UNIXWARE7_BYTEORDER_FIX_FIXIDX 112
tSCC zUnixware7_Byteorder_FixName[] =
"unixware7_byteorder_fix";
@@ -4528,7 +4568,7 @@
*
* Description of Va_I960_Macro fix
*/
-#define VA_I960_MACRO_FIXIDX 112
+#define VA_I960_MACRO_FIXIDX 113
tSCC zVa_I960_MacroName[] =
"va_i960_macro";
@@ -4555,18 +4595,16 @@
/*
* Fix Command Arguments for Va_I960_Macro
*/
-const char* apzVa_I960_MacroPatch[] = { "sed",
- "-e", "s/__vsiz/__vxvsiz/",
- "-e", "s/__vali/__vxvali/",
- "-e", "s/__vpad/__vxvpad/",
- "-e", "s/__alignof__/__vxalignof__/",
+const char* apzVa_I960_MacroPatch[] = {
+ "format",
+ "__vx%1",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Void_Null fix
*/
-#define VOID_NULL_FIXIDX 113
+#define VOID_NULL_FIXIDX 114
tSCC zVoid_NullName[] =
"void_null";
@@ -4584,7 +4622,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zVoid_NullSelect0[] =
- "#[ \t]*define[ \t][ \t]*NULL[ \t].*void";
+ "^#[ \t]*define[ \t]+NULL[ \t]+\\(\\(void[ \t]*\\*\\)0\\)";
#define VOID_NULL_TEST_CT 1
tTestDesc aVoid_NullTests[] = {
@@ -4593,15 +4631,16 @@
/*
* Fix Command Arguments for Void_Null
*/
-const char* apzVoid_NullPatch[] = { "sed",
- "-e", "s/^#[ \t]*define[ \t]*NULL[ \t]*((void[ \t]*\\*)0)/#define NULL 0/",
+const char* apzVoid_NullPatch[] = {
+ "format",
+ "#define NULL 0",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Vxworks_Gcc_Problem fix
*/
-#define VXWORKS_GCC_PROBLEM_FIXIDX 114
+#define VXWORKS_GCC_PROBLEM_FIXIDX 115
tSCC zVxworks_Gcc_ProblemName[] =
"vxworks_gcc_problem";
@@ -4651,7 +4690,7 @@
*
* Description of Vxworks_Needs_Vxtypes fix
*/
-#define VXWORKS_NEEDS_VXTYPES_FIXIDX 115
+#define VXWORKS_NEEDS_VXTYPES_FIXIDX 116
tSCC zVxworks_Needs_VxtypesName[] =
"vxworks_needs_vxtypes";
@@ -4669,7 +4708,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zVxworks_Needs_VxtypesSelect0[] =
- "uint_t[ \t][ \t]*_clocks_per_sec";
+ "uint_t([ \t]+_clocks_per_sec)";
#define VXWORKS_NEEDS_VXTYPES_TEST_CT 1
tTestDesc aVxworks_Needs_VxtypesTests[] = {
@@ -4678,15 +4717,16 @@
/*
* Fix Command Arguments for Vxworks_Needs_Vxtypes
*/
-const char* apzVxworks_Needs_VxtypesPatch[] = { "sed",
- "-e", "s/uint_t/unsigned int/",
+const char* apzVxworks_Needs_VxtypesPatch[] = {
+ "format",
+ "unsigned int%1",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Vxworks_Needs_Vxworks fix
*/
-#define VXWORKS_NEEDS_VXWORKS_FIXIDX 116
+#define VXWORKS_NEEDS_VXWORKS_FIXIDX 117
tSCC zVxworks_Needs_VxworksName[] =
"vxworks_needs_vxworks";
@@ -4704,7 +4744,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zVxworks_Needs_VxworksSelect0[] =
- "#[ \t]define[ \t][ \t]*__INCstath";
+ "#[ \t]define[ \t]+__INCstath";
/*
* perform the 'test' shell command - do fix on success
@@ -4735,7 +4775,7 @@
*
* Description of Vxworks_Time fix
*/
-#define VXWORKS_TIME_FIXIDX 117
+#define VXWORKS_TIME_FIXIDX 118
tSCC zVxworks_TimeName[] =
"vxworks_time";
@@ -4753,7 +4793,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zVxworks_TimeSelect0[] =
- "VOIDFUNCPTR";
+ "#[ \t]*define[ \t]+VOIDFUNCPTR[ \t].*";
/*
* perform the 'test' shell command - do fix on success
@@ -4769,24 +4809,24 @@
/*
* Fix Command Arguments for Vxworks_Time
*/
-const char* apzVxworks_TimePatch[] = { "sed",
- "-e", "/VOIDFUNCPTR/i\\\n\
-#ifndef __gcc_VOIDFUNCPTR_defined\\\n\
-#ifdef __cplusplus\\\n\
-typedef void (*__gcc_VOIDFUNCPTR) (...);\\\n\
-#else\\\n\
-typedef void (*__gcc_VOIDFUNCPTR) ();\\\n\
-#endif\\\n\
-#define __gcc_VOIDFUNCPTR_defined\\\n\
-#endif\n",
- "-e", "s/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g",
+const char* apzVxworks_TimePatch[] = {
+ "format",
+ "#ifndef __gcc_VOIDFUNCPTR_defined\n\
+#ifdef __cplusplus\n\
+typedef void (*__gcc_VOIDFUNCPTR) (...);\n\
+#else\n\
+typedef void (*__gcc_VOIDFUNCPTR) ();\n\
+#endif\n\
+#define __gcc_VOIDFUNCPTR_defined\n\
+#endif\n\
+#define VOIDFUNCPTR __gcc_VOIDFUNCPTR",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of X11_Class fix
*/
-#define X11_CLASS_FIXIDX 118
+#define X11_CLASS_FIXIDX 119
tSCC zX11_ClassName[] =
"x11_class";
@@ -4826,7 +4866,7 @@
*
* Description of X11_Class_Usage fix
*/
-#define X11_CLASS_USAGE_FIXIDX 119
+#define X11_CLASS_USAGE_FIXIDX 120
tSCC zX11_Class_UsageName[] =
"x11_class_usage";
@@ -4841,27 +4881,35 @@
#define apzX11_Class_UsageMachs (const char**)NULL
/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zX11_Class_UsageSelect0[] =
+ " class\\)";
+
+/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zX11_Class_UsageBypass0[] =
"__cplusplus";
-#define X11_CLASS_USAGE_TEST_CT 1
+#define X11_CLASS_USAGE_TEST_CT 2
tTestDesc aX11_Class_UsageTests[] = {
- { TT_NEGREP, zX11_Class_UsageBypass0, (regex_t*)NULL }, };
+ { TT_NEGREP, zX11_Class_UsageBypass0, (regex_t*)NULL },
+ { TT_EGREP, zX11_Class_UsageSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for X11_Class_Usage
*/
-const char* apzX11_Class_UsagePatch[] = { "sed",
- "-e", "s/ class[)]/ c_class)/g",
+const char* apzX11_Class_UsagePatch[] = {
+ "format",
+ " c_class)",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of X11_New fix
*/
-#define X11_NEW_FIXIDX 120
+#define X11_NEW_FIXIDX 121
tSCC zX11_NewName[] =
"x11_new";
@@ -4902,7 +4950,7 @@
*
* Description of X11_Sprintf fix
*/
-#define X11_SPRINTF_FIXIDX 121
+#define X11_SPRINTF_FIXIDX 122
tSCC zX11_SprintfName[] =
"x11_sprintf";
@@ -4920,7 +4968,7 @@
* content selection pattern - do fix if pattern found
*/
tSCC zX11_SprintfSelect0[] =
- "sprintf\\(\\)";
+ "^extern char \\*\tsprintf\\(\\);$";
#define X11_SPRINTF_TEST_CT 1
tTestDesc aX11_SprintfTests[] = {
@@ -4929,10 +4977,11 @@
/*
* Fix Command Arguments for X11_Sprintf
*/
-const char* apzX11_SprintfPatch[] = { "sed",
- "-e", "s,^extern char \\*\tsprintf();$,#ifndef __STDC__\\\n\
-extern char *\tsprintf();\\\n\
-#endif /* !defined __STDC__ */,",
+const char* apzX11_SprintfPatch[] = {
+ "format",
+ "#ifndef __STDC__\n\
+%0\n\
+#endif /* !defined __STDC__ */",
(char*)NULL };
@@ -4940,9 +4989,9 @@
*
* List of all fixes
*/
-#define REGEX_COUNT 121
+#define REGEX_COUNT 124
#define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT 122
+#define FIX_COUNT 123
tFixDesc fixDescList[ FIX_COUNT ] = {
{ zAaa_Ki_IfaceName, zAaa_Ki_IfaceList,
@@ -5467,7 +5516,7 @@
{ zTinfo_CplusplusName, zTinfo_CplusplusList,
apzTinfo_CplusplusMachs,
- TINFO_CPLUSPLUS_TEST_CT, FD_MACH_ONLY,
+ TINFO_CPLUSPLUS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aTinfo_CplusplusTests, apzTinfo_CplusplusPatch },
{ zUltrix_Atof_ParamName, zUltrix_Atof_ParamList,
@@ -5477,9 +5526,14 @@
{ zUltrix_ConstName, zUltrix_ConstList,
apzUltrix_ConstMachs,
- ULTRIX_CONST_TEST_CT, FD_MACH_ONLY,
+ ULTRIX_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aUltrix_ConstTests, apzUltrix_ConstPatch },
+ { zUltrix_Const2Name, zUltrix_Const2List,
+ apzUltrix_Const2Machs,
+ ULTRIX_CONST2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aUltrix_Const2Tests, apzUltrix_Const2Patch },
+
{ zUltrix_Fix_FixprotoName, zUltrix_Fix_FixprotoList,
apzUltrix_Fix_FixprotoMachs,
ULTRIX_FIX_FIXPROTO_TEST_CT, FD_MACH_ONLY,
@@ -5507,12 +5561,12 @@
{ zVa_I960_MacroName, zVa_I960_MacroList,
apzVa_I960_MacroMachs,
- VA_I960_MACRO_TEST_CT, FD_MACH_ONLY,
+ VA_I960_MACRO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVa_I960_MacroTests, apzVa_I960_MacroPatch },
{ zVoid_NullName, zVoid_NullList,
apzVoid_NullMachs,
- VOID_NULL_TEST_CT, FD_MACH_ONLY,
+ VOID_NULL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVoid_NullTests, apzVoid_NullPatch },
{ zVxworks_Gcc_ProblemName, zVxworks_Gcc_ProblemList,
@@ -5522,7 +5576,7 @@
{ zVxworks_Needs_VxtypesName, zVxworks_Needs_VxtypesList,
apzVxworks_Needs_VxtypesMachs,
- VXWORKS_NEEDS_VXTYPES_TEST_CT, FD_MACH_ONLY,
+ VXWORKS_NEEDS_VXTYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVxworks_Needs_VxtypesTests, apzVxworks_Needs_VxtypesPatch },
{ zVxworks_Needs_VxworksName, zVxworks_Needs_VxworksList,
@@ -5532,7 +5586,7 @@
{ zVxworks_TimeName, zVxworks_TimeList,
apzVxworks_TimeMachs,
- VXWORKS_TIME_TEST_CT, FD_MACH_ONLY,
+ VXWORKS_TIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aVxworks_TimeTests, apzVxworks_TimePatch },
{ zX11_ClassName, zX11_ClassList,
@@ -5542,7 +5596,7 @@
{ zX11_Class_UsageName, zX11_Class_UsageList,
apzX11_Class_UsageMachs,
- X11_CLASS_USAGE_TEST_CT, FD_MACH_ONLY,
+ X11_CLASS_USAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aX11_Class_UsageTests, apzX11_Class_UsagePatch },
{ zX11_NewName, zX11_NewList,
@@ -5552,6 +5606,6 @@
{ zX11_SprintfName, zX11_SprintfList,
apzX11_SprintfMachs,
- X11_SPRINTF_TEST_CT, FD_MACH_ONLY,
+ X11_SPRINTF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aX11_SprintfTests, apzX11_SprintfPatch }
};
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- inclhack.def 2000/05/30 20:24:44 1.73
+++ inclhack.def 2000/05/31 14:26:47 1.74
@@ -1612,7 +1612,7 @@
c_fix_arg = "__%0";
c_fix_arg = "reg(ex|off|match)_t[^;]";
- test_text = "`touch inc/sys/lc_core.h`"
+ test_text = "`touch sys/lc_core.h`"
"typedef struct {\n int stuff, mo_suff;\n} regex_t;\n"
"extern regex_t re;\n"
"extern regoff_t ro;\n"
@@ -2601,7 +2601,10 @@
hackname = tinfo_cplusplus;
files = tinfo.h;
select = "[ \t]_cplusplus";
- sed = "s/[ \t]_cplusplus/ __cplusplus/";
+
+ c_fix = format;
+ c_fix_arg = " __cplusplus";
+ test_text = "#ifdef _cplusplus\nint bogus;\n#endif";
};
@@ -2621,25 +2624,47 @@
* parameters not const on DECstation Ultrix V4.0 and OSF/1.
*/
fix = {
- hackname = ultrix_const;
- files = stdio.h;
+ hackname = ultrix_const;
+ files = stdio.h;
+ select = 'perror\( char \*';
- sed = 's@perror( char \*__s );@perror( const char *__s );@';
- sed = 's@fputs( char \*__s,@fputs( const char *__s,@';
- sed = 's@fopen( char \*__filename, char \*__type );@'
- 'fopen( const char *__filename, const char *__type );@';
- sed = 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@';
- sed = 's@fscanf( FILE \*__stream, char \*__format,@'
- 'fscanf( FILE *__stream, const char *__format,@';
- sed = 's@scanf( char \*__format,@scanf( const char *__format,@';
- sed = 's@sscanf( char \*__s, char \*__format,@'
- 'sscanf( const char *__s, const char *__format,@';
- sed = 's@popen(char \*, char \*);@popen(const char *, const char *);@';
- sed = 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@';
+ c_fix = format;
+ c_fix_arg = "%1 const %3 *__";
+ c_fix_arg = "([ \t*](perror|fputs|fwrite|scanf|fscanf)\\(.*)"
+ "[ \t]+(char|void) \\*__";
+
+ test_text =
+ "extern void perror( char *__s );\n"
+ "extern int fputs( char *__s, FILE *);\n"
+ "extern size_t fwrite( void *__ptr, size_t, size_t, FILE *);\n"
+ "extern int fscanf( FILE *__stream, char *__format, ...);\n"
+ "extern int scanf( char *__format, ...);\n";
};
/*
+ * parameters not const on DECstation Ultrix V4.0 and OSF/1.
+ */
+fix = {
+ hackname = ultrix_const2;
+ files = stdio.h;
+
+ select = '\*fopen\( char \*';
+ c_fix = format;
+ c_fix_arg = "%1( const char *%3, const char *";
+ c_fix_arg = "([ \t*](fopen|sscanf|popen|tempnam))\\("
+ "[ \t]*char[ \t]*\\*([^,]*),"
+ "[ \t]*char[ \t]*\\*[ \t]*";
+
+ test_text =
+ "extern FILE *fopen( char *__filename, char *__type );\n"
+ "extern int sscanf( char *__s, char *__format, ...);\n"
+ "extern FILE *popen(char *, char *);\n"
+ "extern char *tempnam(char*,char*);\n";
+};
+
+
+/*
* Ultrix V4.[35] puts the declaration of uname before the definition
* of struct utsname, so the prototype (added by fixproto) causes havoc.
*/
@@ -2649,6 +2674,9 @@
select = ULTRIX;
sed = "/^[ \t]*extern[ \t]*int[ \t]*uname();$/i\\\n"
"struct utsname;\n";
+
+ test_text =
+ "/* ULTRIX's uname */\nextern\tint\tuname();";
};
@@ -2657,9 +2685,12 @@
*/
fix = {
hackname = ultrix_ifdef;
- select = "#ifdef KERNEL[ \t]*[^ \t]";
+ select = "#ifdef KERNEL[ \t]+[^ \t]";
files = sys/file.h;
sed = "s/#ifdef KERNEL/#if defined(KERNEL)/";
+
+ test_text =
+ "#ifdef KERNEL\t&& defined( mumbojumbo )\nint oops;\n#endif";
};
@@ -2721,13 +2752,18 @@
* Fix definitions of macros used by va-i960.h in VxWorks header file.
*/
fix = {
- hackname = va_i960_macro;
- files = arch/i960/archI960.h;
- select = "__(vsiz|vali|vpad|alignof__)";
- sed = "s/__vsiz/__vxvsiz/";
- sed = "s/__vali/__vxvali/";
- sed = "s/__vpad/__vxvpad/";
- sed = "s/__alignof__/__vxalignof__/";
+ hackname = va_i960_macro;
+ files = arch/i960/archI960.h;
+ select = "__(vsiz|vali|vpad|alignof__)";
+
+ c_fix = format;
+ c_fix_arg = "__vx%1";
+
+ test_text =
+ "extern int __vsiz vsiz;\n"
+ "extern int __vali vali;\n"
+ "extern int __vpad vpad;\n"
+ "#define __alignof__(x) ...";
};
@@ -2736,21 +2772,22 @@
* which is illegal in ANSI C++.
*/
fix = {
- hackname = void_null;
- files = curses.h;
- files = dbm.h;
- files = locale.h;
- files = stdio.h;
- files = stdlib.h;
- files = string.h;
- files = time.h;
- files = unistd.h;
- files = sys/dir.h;
- files = sys/param.h;
- files = sys/types.h;
- select = "#[ \t]*define[ \t][ \t]*NULL[ \t].*void";
- sed = "s/^#[ \t]*define[ \t]*NULL[ \t]*((void[ \t]*\\*)0)"
- "/#define NULL 0/";
+ hackname = void_null;
+ files = curses.h;
+ files = dbm.h;
+ files = locale.h;
+ files = stdio.h;
+ files = stdlib.h;
+ files = string.h;
+ files = time.h;
+ files = unistd.h;
+ files = sys/dir.h;
+ files = sys/param.h;
+ files = sys/types.h;
+ select = "^#[ \t]*define[ \t]+NULL[ \t]+\\(\\(void[ \t]*\\*\\)0\\)";
+ c_fix = format;
+ c_fix_arg = "#define NULL 0";
+ test_text = "# define\tNULL \t((void *)0) /* typed NULL */";
};
@@ -2785,6 +2822,13 @@
sed = "/[ \t]wchar_t/a\\\n"
"#endif\n";
+
+ test_text =
+ "#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__\n"
+ "typedef unsigned int size_t;\n"
+ "typedef long ptrdiff_t;\n"
+ "typedef unsigned short wchar_t;\n"
+ "#endif /* __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__ */\n";
};
@@ -2792,10 +2836,11 @@
* Fix VxWorks <time.h> to not require including <vxTypes.h>.
*/
fix = {
- hackname = vxworks_needs_vxtypes;
- files = time.h;
- select = "uint_t[ \t][ \t]*_clocks_per_sec";
- sed = "s/uint_t/unsigned int/";
+ hackname = vxworks_needs_vxtypes;
+ files = time.h;
+ select = "uint_t([ \t]+_clocks_per_sec)";
+ c_fix = format;
+ c_fix_arg = "unsigned int%1";
test_text = "uint_t\t_clocks_per_sec;";
};
@@ -2809,10 +2854,14 @@
test = " -r types/vxTypesOld.h";
test = " -n \"`egrep '#include' $file`\"";
test = " -n \"`egrep ULONG $file`\"";
- select = "#[ \t]define[ \t][ \t]*__INCstath";
+ select = "#[ \t]define[ \t]+__INCstath";
sed = "/#[ \t]define[ \t][ \t]*__INCstath/a\\\n"
"#include <types/vxTypesOld.h>\n";
+
+ test_text = "`touch types/vxTypesOld.h`"
+ "#include </dev/null> /* ULONG */\n"
+ "# define\t__INCstath <sys/stat.h>";
};
@@ -2822,19 +2871,24 @@
fix = {
hackname = vxworks_time;
files = time.h;
- select = "VOIDFUNCPTR";
test = " -r vxWorks.h";
- sed = "/VOIDFUNCPTR/i\\\n"
- "#ifndef __gcc_VOIDFUNCPTR_defined\\\n"
- "#ifdef __cplusplus\\\n"
- "typedef void (*__gcc_VOIDFUNCPTR) (...);\\\n"
- "#else\\\n"
- "typedef void (*__gcc_VOIDFUNCPTR) ();\\\n"
- "#endif\\\n"
- "#define __gcc_VOIDFUNCPTR_defined\\\n"
- "#endif\n";
+
+ select = "#[ \t]*define[ \t]+VOIDFUNCPTR[ \t].*";
+ c_fix = format;
+
+ c_fix_arg =
+ "#ifndef __gcc_VOIDFUNCPTR_defined\n"
+ "#ifdef __cplusplus\n"
+ "typedef void (*__gcc_VOIDFUNCPTR) (...);\n"
+ "#else\n"
+ "typedef void (*__gcc_VOIDFUNCPTR) ();\n"
+ "#endif\n"
+ "#define __gcc_VOIDFUNCPTR_defined\n"
+ "#endif\n"
+ "#define VOIDFUNCPTR __gcc_VOIDFUNCPTR";
- sed = "s/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g";
+ test_text = "`touch vxWorks.h`"
+ "#define VOIDFUNCPTR (void(*)())";
};
@@ -2867,7 +2921,11 @@
hackname = x11_class_usage;
files = Xm/BaseClassI.h;
bypass = "__cplusplus";
- sed = "s/ class[)]/ c_class)/g";
+
+ select = " class\\)";
+ c_fix = format;
+ c_fix_arg = " c_class)";
+
test_text = "extern mumble (int class);\n";
};
@@ -2903,11 +2961,11 @@
hackname = x11_sprintf;
files = X11/Xmu.h;
files = X11/Xmu/Xmu.h;
- select = 'sprintf\(\)';
+ select = "^extern char \\*\tsprintf\\(\\);$";
+
+ c_fix = format;
+ c_fix_arg = "#ifndef __STDC__\n%0\n#endif /* !defined __STDC__ */";
- sed = "s,^extern char \\*\tsprintf();$,#ifndef __STDC__\\\n"
- "extern char *\tsprintf();\\\n"
- "#endif /* !defined __STDC__ */,";
test_text = "extern char *\tsprintf();";
};
Index: tests/base/curses.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/curses.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- curses.h 2000/05/30 19:39:28 1.1
+++ curses.h 2000/05/31 14:26:48 1.2
@@ -23,3 +23,10 @@
#if defined( LYNX_VOID_INT_CHECK )
/* curses foiled again */
#endif /* LYNX_VOID_INT_CHECK */
+
+
+#if defined( VOID_NULL_CHECK )
+#ifndef NULL
+#define NULL 0 /* typed NULL */
+#endif
+#endif /* VOID_NULL_CHECK */
Index: tests/base/stdio.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/stdio.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stdio.h 2000/05/30 19:39:28 1.1
+++ stdio.h 2000/05/31 14:44:35 1.2
@@ -32,4 +32,23 @@
#endif /* STDIO_STDARG_H_CHECK */
+
+#if defined( ULTRIX_CONST_CHECK )
+extern void perror( const char *__s );
+extern int fputs( const char *__s, FILE *);
+extern size_t fwrite( const void *__ptr, size_t, size_t, FILE *);
+extern int fscanf( FILE *__stream, const char *__format, ...);
+extern int scanf( const char *__format, ...);
+
+#endif /* ULTRIX_CONST_CHECK */
+
+
+#if defined( ULTRIX_CONST2_CHECK )
+extern FILE *fopen( const char *__filename, const char *__type );
+extern int sscanf( const char *__s, const char *__format, ...);
+extern FILE *popen( const char *, const char *);
+extern char *tempnam( const char *, const char *);
+
+#endif /* ULTRIX_CONST2_CHECK */
+
#endif /* FIXINC_STDIO_STDARG_H_CHECK */
Index: tests/base/time.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/time.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- time.h 2000/05/30 19:39:28 1.1
+++ time.h 2000/05/31 14:44:35 1.2
@@ -12,4 +12,17 @@
unsigned int _clocks_per_sec;
#endif /* VXWORKS_NEEDS_VXTYPES_CHECK */
+
+#if defined( VXWORKS_TIME_CHECK )
+#ifndef __gcc_VOIDFUNCPTR_defined
+#ifdef __cplusplus
+typedef void (*__gcc_VOIDFUNCPTR) (...);
+#else
+typedef void (*__gcc_VOIDFUNCPTR) ();
+#endif
+#define __gcc_VOIDFUNCPTR_defined
+#endif
+#define VOIDFUNCPTR __gcc_VOIDFUNCPTR
+#endif /* VXWORKS_TIME_CHECK */
+
#endif /* FIXINC_M88K_MULTI_INCL_CHECK */
Index: tests/base/sys/asm.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/sys/asm.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- asm.h 2000/05/30 19:39:33 1.1
+++ asm.h 2000/05/31 14:44:35 1.2
@@ -1,5 +1,5 @@
#if defined( IRIX_ASM_APOSTROPHE_CHECK )
-# and we are on vacation
+ # and we are on vacation
#endif /* IRIX_ASM_APOSTROPHE_CHECK */
Index: tests/base/sys/stat.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/sys/stat.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stat.h 2000/05/30 19:39:33 1.1
+++ stat.h 2000/05/31 14:44:35 1.2
@@ -16,7 +16,7 @@
extern "C" {
#endif /* __cplusplus */
static int stat(const char *__f, struct stat *__p) {
-return __stat32(__f, __p);
+ return __stat32(__f, __p);
}
#if __cplusplus
}
@@ -27,13 +27,20 @@
extern "C" {
#endif /* __cplusplus */
static int stat(__f, __p)
-char *__f;
-struct stat *__p;
+ char *__f;
+ struct stat *__p;
{
-return __stat32(__f, __p);
+ return __stat32(__f, __p);
}
#if __cplusplus
}
#endif /* __cplusplus */
#endif
#endif /* SCO_STATIC_FUNC_CHECK */
+
+
+#if defined( VXWORKS_NEEDS_VXWORKS_CHECK )
+#include </dev/null> /* ULONG */
+# define __INCstath <sys/stat.h>
+#include <types/vxTypesOld.h>
+#endif /* VXWORKS_NEEDS_VXWORKS_CHECK */
Index: tests/base/sys/wait.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/tests/base/sys/wait.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- wait.h 2000/05/30 19:39:33 1.1
+++ wait.h 2000/05/31 14:44:35 1.2
@@ -4,7 +4,7 @@
/* bos325, */
struct rusage;
extern pid_t wait3();
-/* pid_t wait3(int *, int, struct rusage *); */
+ /* pid_t wait3(int *, int, struct rusage *); */
#endif /* AIX_SYSWAIT_CHECK */