Commit a8228686 by Bruce Korb Committed by Bruce Korb

yet more applications of c_fix=format + tests

From-SVN: r34055
parent fbd40359
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* fixinc/inclhack.def: more applications of c_fix=format + tests * fixinc/inclhack.def: more applications of c_fix=format + tests
* fixinc/check.diff: regenerated * fixinc/check.diff: regenerated
* fixinc/fixincl.x: regenerated
Sat May 20 09:30:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Sat May 20 09:30:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
...@@ -81,6 +81,36 @@ ...@@ -81,6 +81,36 @@
}; };
! extern Wedged( Widget c_new, Widget old ); ! extern Wedged( Widget c_new, Widget old );
#endif /* X11_NEW_CHECK */ #endif /* X11_NEW_CHECK */
*** inc/ansi/math.h
--- res/ansi/math.h
***************
*** 1,5 ****
#if defined( NEXT_MATH_PREFIX_CHECK )
! extern double __const__ mumble();
#endif /* NEXT_MATH_PREFIX_CHECK */
--- 1,5 ----
#if defined( NEXT_MATH_PREFIX_CHECK )
! extern double mumble();
#endif /* NEXT_MATH_PREFIX_CHECK */
*** inc/ansi/stdlib.h
--- res/ansi/stdlib.h
***************
*** 1,5 ****
#if defined( NEXT_VOLITILE_CHECK )
! extern volatile void abort();
#endif /* NEXT_VOLITILE_CHECK */
--- 1,5 ----
#if defined( NEXT_VOLITILE_CHECK )
! extern void abort();
#endif /* NEXT_VOLITILE_CHECK */
*** inc/assert.h *** inc/assert.h
--- res/assert.h --- res/assert.h
*************** ***************
...@@ -109,6 +139,21 @@ ...@@ -109,6 +139,21 @@
+ #endif /* FIXINC_BROKEN_ASSERT_STDIO_CHECK */ + #endif /* FIXINC_BROKEN_ASSERT_STDIO_CHECK */
+ +
+ #endif /* FIXINC_BROKEN_ASSERT_STDLIB_CHECK */ + #endif /* FIXINC_BROKEN_ASSERT_STDLIB_CHECK */
*** inc/bsd/libc.h
--- res/bsd/libc.h
***************
*** 1,5 ****
#if defined( NEXT_TEMPLATE_CHECK )
! extern mumble( char * template); /* fix */
#endif /* NEXT_TEMPLATE_CHECK */
--- 1,5 ----
#if defined( NEXT_TEMPLATE_CHECK )
! extern mumble( char *); /* fix */
#endif /* NEXT_TEMPLATE_CHECK */
*** inc/c_asm.h *** inc/c_asm.h
--- res/c_asm.h --- res/c_asm.h
*************** ***************
...@@ -235,10 +280,25 @@ ...@@ -235,10 +280,25 @@
# define DBL_DIG 0 /* somthin' */ # define DBL_DIG 0 /* somthin' */
+ #endif + #endif
#endif /* LIMITS_IFNDEFS_CHECK */ #endif /* LIMITS_IFNDEFS_CHECK */
*** inc/machine/ansi.h
--- res/machine/ansi.h
***************
*** 1,5 ****
#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
! # define _BSD_VA_LIST_ char**
#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
--- 1,5 ----
#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
! # define _BSD_VA_LIST_ __builtin_va_list
#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
*** inc/math.h *** inc/math.h
--- res/math.h --- res/math.h
*************** ***************
*** 1,44 **** *** 1,41 ****
#if defined( BROKEN_CABS_CHECK ) #if defined( BROKEN_CABS_CHECK )
...@@ -280,10 +340,7 @@ ...@@ -280,10 +340,7 @@
#endif /* M88K_BAD_HYPOT_OPT_CHECK */ #endif /* M88K_BAD_HYPOT_OPT_CHECK */
#if defined( MATH_EXCEPTION_CHECK ) --- 1,61 ----
typedef struct exception t_math_exception;
#endif /* MATH_EXCEPTION_CHECK */
--- 1,69 ----
+ #ifndef FIXINC_MATH_EXCEPTION_CHECK + #ifndef FIXINC_MATH_EXCEPTION_CHECK
+ #define FIXINC_MATH_EXCEPTION_CHECK 1 + #define FIXINC_MATH_EXCEPTION_CHECK 1
+ +
...@@ -345,9 +402,16 @@ ...@@ -345,9 +402,16 @@
#endif /* M88K_BAD_HYPOT_OPT_CHECK */ #endif /* M88K_BAD_HYPOT_OPT_CHECK */
#if defined( MATH_EXCEPTION_CHECK ) ***************
typedef struct exception t_math_exception; *** 45,49 ****
#endif /* MATH_EXCEPTION_CHECK */ --- 65,76 ----
#if defined( MATH_HUGE_VAL_IFNDEF_CHECK )
+ #ifndef HUGE_VAL
# define HUGE_VAL 3.4e+40
+ #endif
#endif /* MATH_HUGE_VAL_IFNDEF_CHECK */
+ #ifdef __cplusplus + #ifdef __cplusplus
+ #undef exception + #undef exception
+ #endif + #endif
...@@ -469,7 +533,7 @@ ...@@ -469,7 +533,7 @@
*** inc/stdlib.h *** inc/stdlib.h
--- res/stdlib.h --- res/stdlib.h
*************** ***************
*** 1,7 **** *** 1,12 ****
#if defined( ARM_WCHAR_CHECK ) #if defined( ARM_WCHAR_CHECK )
...@@ -477,7 +541,12 @@ ...@@ -477,7 +541,12 @@
! # define __wchar_t short ! # define __wchar_t short
# endif /* __wchar_t */ # endif /* __wchar_t */
#endif /* ARM_WCHAR_CHECK */ #endif /* ARM_WCHAR_CHECK */
--- 1,7 ----
#if defined( NEWS_OS_RECURSION_CHECK )
#include <stdlib.h>
#endif /* NEWS_OS_RECURSION_CHECK */
--- 1,14 ----
#if defined( ARM_WCHAR_CHECK ) #if defined( ARM_WCHAR_CHECK )
...@@ -485,6 +554,13 @@ ...@@ -485,6 +554,13 @@
! # define _GCC_WCHAR_T short ! # define _GCC_WCHAR_T short
# endif /* __wchar_t */ # endif /* __wchar_t */
#endif /* ARM_WCHAR_CHECK */ #endif /* ARM_WCHAR_CHECK */
#if defined( NEWS_OS_RECURSION_CHECK )
+ #ifdef BOGUS_RECURSION
#include <stdlib.h>
+ #endif
#endif /* NEWS_OS_RECURSION_CHECK */
*** inc/sundev/vuid_event.h *** inc/sundev/vuid_event.h
--- res/sundev/vuid_event.h --- res/sundev/vuid_event.h
*************** ***************
...@@ -729,7 +805,7 @@ ...@@ -729,7 +805,7 @@
*** inc/testing.h *** inc/testing.h
--- res/testing.h --- res/testing.h
*************** ***************
*** 1,35 **** *** 1,36 ****
#if defined( CTRL_QUOTES_DEF_CHECK ) #if defined( CTRL_QUOTES_DEF_CHECK )
...@@ -763,7 +839,7 @@ ...@@ -763,7 +839,7 @@
#define NULL ((void*)0) #define NULL ((void*)0)
#endif /* UNDEFINE_NULL_CHECK */ #endif /* UNDEFINE_NULL_CHECK */
--- 1,39 ---- --- 1,40 ----
#if defined( CTRL_QUOTES_DEF_CHECK ) #if defined( CTRL_QUOTES_DEF_CHECK )
......
...@@ -983,9 +983,10 @@ tTestDesc aArm_WcharTests[] = { ...@@ -983,9 +983,10 @@ tTestDesc aArm_WcharTests[] = {
/* /*
* Fix Command Arguments for Arm_Wchar * Fix Command Arguments for Arm_Wchar
*/ */
const char* apzArm_WcharPatch[] = { "sed", const char* apzArm_WcharPatch[] = {
"-e", "s/\\(#[ \t]*ifndef[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/", "format",
"-e", "s/\\(#[ \t]*define[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/", "%1_GCC_WCHAR_T",
"(#[ \t]*(ifndef|define)[ \t]+)__wchar_t",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -1048,8 +1049,15 @@ tSCC zAvoid_Bool_DefineList[] = ...@@ -1048,8 +1049,15 @@ tSCC zAvoid_Bool_DefineList[] =
tSCC zAvoid_Bool_DefineSelect0[] = tSCC zAvoid_Bool_DefineSelect0[] =
"#[ \t]*define[ \t]+bool[ \t]"; "#[ \t]*define[ \t]+bool[ \t]";
#define AVOID_BOOL_DEFINE_TEST_CT 1 /*
* content bypass pattern - skip fix if pattern found
*/
tSCC zAvoid_Bool_DefineBypass0[] =
"we must use the C\\+\\+ compiler's type";
#define AVOID_BOOL_DEFINE_TEST_CT 2
tTestDesc aAvoid_Bool_DefineTests[] = { tTestDesc aAvoid_Bool_DefineTests[] = {
{ TT_NEGREP, zAvoid_Bool_DefineBypass0, (regex_t*)NULL },
{ TT_EGREP, zAvoid_Bool_DefineSelect0, (regex_t*)NULL }, }; { TT_EGREP, zAvoid_Bool_DefineSelect0, (regex_t*)NULL }, };
/* /*
...@@ -1087,8 +1095,15 @@ tSCC zAvoid_Bool_TypeList[] = ...@@ -1087,8 +1095,15 @@ tSCC zAvoid_Bool_TypeList[] =
tSCC zAvoid_Bool_TypeSelect0[] = tSCC zAvoid_Bool_TypeSelect0[] =
"^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;"; "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;";
#define AVOID_BOOL_TYPE_TEST_CT 1 /*
* content bypass pattern - skip fix if pattern found
*/
tSCC zAvoid_Bool_TypeBypass0[] =
"we must use the C\\+\\+ compiler's type";
#define AVOID_BOOL_TYPE_TEST_CT 2
tTestDesc aAvoid_Bool_TypeTests[] = { tTestDesc aAvoid_Bool_TypeTests[] = {
{ TT_NEGREP, zAvoid_Bool_TypeBypass0, (regex_t*)NULL },
{ TT_EGREP, zAvoid_Bool_TypeSelect0, (regex_t*)NULL }, }; { TT_EGREP, zAvoid_Bool_TypeSelect0, (regex_t*)NULL }, };
/* /*
...@@ -1925,8 +1940,9 @@ tTestDesc aHpux_SystimeTests[] = { ...@@ -1925,8 +1940,9 @@ tTestDesc aHpux_SystimeTests[] = {
/* /*
* Fix Command Arguments for Hpux_Systime * Fix Command Arguments for Hpux_Systime
*/ */
const char* apzHpux_SystimePatch[] = { "sed", const char* apzHpux_SystimePatch[] = {
"-e", "s/^extern struct sigevent;/struct sigevent;/", "format",
"struct sigevent;",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2135,9 +2151,9 @@ tTestDesc aLimits_IfndefsTests[] = { ...@@ -2135,9 +2151,9 @@ tTestDesc aLimits_IfndefsTests[] = {
const char* apzLimits_IfndefsPatch[] = { const char* apzLimits_IfndefsPatch[] = {
"format", "format",
"#ifndef %1\n\ "#ifndef %1\n\
%0#endif\n", %0\n\
"^[ \t]*#[ \t]*define[ \t]+((FLT|DBL)_(MIN|MAX|DIG))[ \t][^\n\ #endif",
]*\n", "^[ \t]*#[ \t]*define[ \t]+((FLT|DBL)_(MIN|MAX|DIG))[ \t].*",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2360,7 +2376,7 @@ tSCC zMachine_Ansi_H_Va_ListList[] = ...@@ -2360,7 +2376,7 @@ tSCC zMachine_Ansi_H_Va_ListList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zMachine_Ansi_H_Va_ListSelect0[] = tSCC zMachine_Ansi_H_Va_ListSelect0[] =
"_BSD_VA_LIST_"; "define[ \t]+_BSD_VA_LIST_[ \t]";
/* /*
* content bypass pattern - skip fix if pattern found * content bypass pattern - skip fix if pattern found
...@@ -2376,8 +2392,10 @@ tTestDesc aMachine_Ansi_H_Va_ListTests[] = { ...@@ -2376,8 +2392,10 @@ tTestDesc aMachine_Ansi_H_Va_ListTests[] = {
/* /*
* Fix Command Arguments for Machine_Ansi_H_Va_List * Fix Command Arguments for Machine_Ansi_H_Va_List
*/ */
const char* apzMachine_Ansi_H_Va_ListPatch[] = { "sed", const char* apzMachine_Ansi_H_Va_ListPatch[] = {
"-e", "s/\\(_BSD_VA_LIST_[ \t][ \t]*\\).*$/\\1__builtin_va_list/", "format",
"%1__builtin_va_list",
"(define[ \t]+_BSD_VA_LIST_[ \t]+).*",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2520,7 +2538,7 @@ tSCC zMath_Huge_Val_IfndefName[] = ...@@ -2520,7 +2538,7 @@ tSCC zMath_Huge_Val_IfndefName[] =
* File name selection pattern * File name selection pattern
*/ */
tSCC zMath_Huge_Val_IfndefList[] = tSCC zMath_Huge_Val_IfndefList[] =
"|math/math.h|"; "|math.h|math/math.h|";
/* /*
* Machine/OS name selection pattern * Machine/OS name selection pattern
*/ */
...@@ -2530,7 +2548,7 @@ tSCC zMath_Huge_Val_IfndefList[] = ...@@ -2530,7 +2548,7 @@ tSCC zMath_Huge_Val_IfndefList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zMath_Huge_Val_IfndefSelect0[] = tSCC zMath_Huge_Val_IfndefSelect0[] =
"define[ \t]*HUGE_VAL"; "define[ \t]+HUGE_VAL";
#define MATH_HUGE_VAL_IFNDEF_TEST_CT 1 #define MATH_HUGE_VAL_IFNDEF_TEST_CT 1
tTestDesc aMath_Huge_Val_IfndefTests[] = { tTestDesc aMath_Huge_Val_IfndefTests[] = {
...@@ -2539,11 +2557,12 @@ tTestDesc aMath_Huge_Val_IfndefTests[] = { ...@@ -2539,11 +2557,12 @@ tTestDesc aMath_Huge_Val_IfndefTests[] = {
/* /*
* Fix Command Arguments for Math_Huge_Val_Ifndef * Fix Command Arguments for Math_Huge_Val_Ifndef
*/ */
const char* apzMath_Huge_Val_IfndefPatch[] = { "sed", const char* apzMath_Huge_Val_IfndefPatch[] = {
"-e", "/define[ \t]HUGE_VAL[ \t]/i\\\n\ "format",
#ifndef HUGE_VAL\n", "#ifndef HUGE_VAL\n\
"-e", "/define[ \t]HUGE_VAL[ \t]/a\\\n\ %0\n\
#endif\n", #endif",
"^[ \t]*#[ \t]*define[ \t]+HUGE_VAL[ \t].*",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2697,7 +2716,7 @@ tSCC zNews_Os_RecursionList[] = ...@@ -2697,7 +2716,7 @@ tSCC zNews_Os_RecursionList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zNews_Os_RecursionSelect0[] = tSCC zNews_Os_RecursionSelect0[] =
"#include <stdlib.h>"; "#include <stdlib\\.h>";
#define NEWS_OS_RECURSION_TEST_CT 1 #define NEWS_OS_RECURSION_TEST_CT 1
tTestDesc aNews_Os_RecursionTests[] = { tTestDesc aNews_Os_RecursionTests[] = {
...@@ -2706,11 +2725,11 @@ tTestDesc aNews_Os_RecursionTests[] = { ...@@ -2706,11 +2725,11 @@ tTestDesc aNews_Os_RecursionTests[] = {
/* /*
* Fix Command Arguments for News_Os_Recursion * Fix Command Arguments for News_Os_Recursion
*/ */
const char* apzNews_Os_RecursionPatch[] = { "sed", const char* apzNews_Os_RecursionPatch[] = {
"-e", "/^#include <stdlib.h>/i\\\n\ "format",
#ifdef BOGUS_RECURSION\n", "#ifdef BOGUS_RECURSION\n\
"-e", "/^#include <stdlib.h>/a\\\n\ %0\n\
#endif\n", #endif",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2735,7 +2754,7 @@ tSCC zNext_Math_PrefixList[] = ...@@ -2735,7 +2754,7 @@ tSCC zNext_Math_PrefixList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zNext_Math_PrefixSelect0[] = tSCC zNext_Math_PrefixSelect0[] =
"^extern.*double.*__const__.*"; "^extern[ \t]+double[ \t]+__const__[ \t]";
#define NEXT_MATH_PREFIX_TEST_CT 1 #define NEXT_MATH_PREFIX_TEST_CT 1
tTestDesc aNext_Math_PrefixTests[] = { tTestDesc aNext_Math_PrefixTests[] = {
...@@ -2744,12 +2763,10 @@ tTestDesc aNext_Math_PrefixTests[] = { ...@@ -2744,12 +2763,10 @@ tTestDesc aNext_Math_PrefixTests[] = {
/* /*
* Fix Command Arguments for Next_Math_Prefix * Fix Command Arguments for Next_Math_Prefix
*/ */
const char* apzNext_Math_PrefixPatch[] = { "sed", const char* apzNext_Math_PrefixPatch[] = {
"-e", "/^extern.*double.*__const__.*sqrt(/s/__const__//", "format",
"-e", "/^extern.*double.*__const__.*fabs(/s/__const__//", "extern double %1(",
"-e", "/^extern.*double.*__const__.*cos(/s/__const__//", "^extern[ \t]+double[ \t]+__const__[ \t]+([a-z]+)\\(",
"-e", "/^extern.*double.*__const__.*hypot(/s/__const__//",
"-e", "/^extern.*double.*__const__.*sin(/s/__const__//",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2774,7 +2791,7 @@ tSCC zNext_TemplateList[] = ...@@ -2774,7 +2791,7 @@ tSCC zNext_TemplateList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zNext_TemplateSelect0[] = tSCC zNext_TemplateSelect0[] =
"template"; "[ \t]template\\)";
#define NEXT_TEMPLATE_TEST_CT 1 #define NEXT_TEMPLATE_TEST_CT 1
tTestDesc aNext_TemplateTests[] = { tTestDesc aNext_TemplateTests[] = {
...@@ -2783,9 +2800,10 @@ tTestDesc aNext_TemplateTests[] = { ...@@ -2783,9 +2800,10 @@ tTestDesc aNext_TemplateTests[] = {
/* /*
* Fix Command Arguments for Next_Template * Fix Command Arguments for Next_Template
*/ */
const char* apzNext_TemplatePatch[] = { "sed", const char* apzNext_TemplatePatch[] = {
"-e", "/\\(.*template\\)/s/template//", "format",
"-e", "/extern.*volatile.*void.*abort/s/volatile//", "(%1)",
"\\(([^)]*)[ \t]template\\)",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -2810,7 +2828,7 @@ tSCC zNext_VolitileList[] = ...@@ -2810,7 +2828,7 @@ tSCC zNext_VolitileList[] =
* content selection pattern - do fix if pattern found * content selection pattern - do fix if pattern found
*/ */
tSCC zNext_VolitileSelect0[] = tSCC zNext_VolitileSelect0[] =
"volatile"; "^extern[ \t]+volatile[ \t]+void[ \t]";
#define NEXT_VOLITILE_TEST_CT 1 #define NEXT_VOLITILE_TEST_CT 1
tTestDesc aNext_VolitileTests[] = { tTestDesc aNext_VolitileTests[] = {
...@@ -2819,9 +2837,10 @@ tTestDesc aNext_VolitileTests[] = { ...@@ -2819,9 +2837,10 @@ tTestDesc aNext_VolitileTests[] = {
/* /*
* Fix Command Arguments for Next_Volitile * Fix Command Arguments for Next_Volitile
*/ */
const char* apzNext_VolitilePatch[] = { "sed", const char* apzNext_VolitilePatch[] = {
"-e", "/extern.*volatile.*void.*exit/s/volatile//", "format",
"-e", "/extern.*volatile.*void.*abort/s/volatile//", "extern void %1(",
"^extern[ \t]+volatile[ \t]+void[ \t]+(exit|abort)\\(",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -4831,7 +4850,7 @@ extern char *\tsprintf();\\\n\ ...@@ -4831,7 +4850,7 @@ extern char *\tsprintf();\\\n\
* *
* List of all fixes * List of all fixes
*/ */
#define REGEX_COUNT 113 #define REGEX_COUNT 115
#define MACH_LIST_SIZE_LIMIT 279 #define MACH_LIST_SIZE_LIMIT 279
#define FIX_COUNT 121 #define FIX_COUNT 121
...@@ -4933,7 +4952,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -4933,7 +4952,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zArm_WcharName, zArm_WcharList, { zArm_WcharName, zArm_WcharList,
apzArm_WcharMachs, apzArm_WcharMachs,
ARM_WCHAR_TEST_CT, FD_MACH_ONLY, ARM_WCHAR_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aArm_WcharTests, apzArm_WcharPatch }, aArm_WcharTests, apzArm_WcharPatch },
{ zAux_AsmName, zAux_AsmList, { zAux_AsmName, zAux_AsmList,
...@@ -5058,7 +5077,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5058,7 +5077,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zHpux_SystimeName, zHpux_SystimeList, { zHpux_SystimeName, zHpux_SystimeList,
apzHpux_SystimeMachs, apzHpux_SystimeMachs,
HPUX_SYSTIME_TEST_CT, FD_MACH_ONLY, HPUX_SYSTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux_SystimeTests, apzHpux_SystimePatch }, aHpux_SystimeTests, apzHpux_SystimePatch },
{ zIp_Missing_SemiName, zIp_Missing_SemiList, { zIp_Missing_SemiName, zIp_Missing_SemiList,
...@@ -5118,7 +5137,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5118,7 +5137,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zMachine_Ansi_H_Va_ListName, zMachine_Ansi_H_Va_ListList, { zMachine_Ansi_H_Va_ListName, zMachine_Ansi_H_Va_ListList,
apzMachine_Ansi_H_Va_ListMachs, apzMachine_Ansi_H_Va_ListMachs,
MACHINE_ANSI_H_VA_LIST_TEST_CT, FD_MACH_ONLY, MACHINE_ANSI_H_VA_LIST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aMachine_Ansi_H_Va_ListTests, apzMachine_Ansi_H_Va_ListPatch }, aMachine_Ansi_H_Va_ListTests, apzMachine_Ansi_H_Va_ListPatch },
{ zMachine_NameName, zMachine_NameList, { zMachine_NameName, zMachine_NameList,
...@@ -5138,7 +5157,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5138,7 +5157,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zMath_Huge_Val_IfndefName, zMath_Huge_Val_IfndefList, { zMath_Huge_Val_IfndefName, zMath_Huge_Val_IfndefList,
apzMath_Huge_Val_IfndefMachs, apzMath_Huge_Val_IfndefMachs,
MATH_HUGE_VAL_IFNDEF_TEST_CT, FD_MACH_ONLY, MATH_HUGE_VAL_IFNDEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aMath_Huge_Val_IfndefTests, apzMath_Huge_Val_IfndefPatch }, aMath_Huge_Val_IfndefTests, apzMath_Huge_Val_IfndefPatch },
{ zNested_MotorolaName, zNested_MotorolaList, { zNested_MotorolaName, zNested_MotorolaList,
...@@ -5163,22 +5182,22 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5163,22 +5182,22 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zNews_Os_RecursionName, zNews_Os_RecursionList, { zNews_Os_RecursionName, zNews_Os_RecursionList,
apzNews_Os_RecursionMachs, apzNews_Os_RecursionMachs,
NEWS_OS_RECURSION_TEST_CT, FD_MACH_ONLY, NEWS_OS_RECURSION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aNews_Os_RecursionTests, apzNews_Os_RecursionPatch }, aNews_Os_RecursionTests, apzNews_Os_RecursionPatch },
{ zNext_Math_PrefixName, zNext_Math_PrefixList, { zNext_Math_PrefixName, zNext_Math_PrefixList,
apzNext_Math_PrefixMachs, apzNext_Math_PrefixMachs,
NEXT_MATH_PREFIX_TEST_CT, FD_MACH_ONLY, NEXT_MATH_PREFIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aNext_Math_PrefixTests, apzNext_Math_PrefixPatch }, aNext_Math_PrefixTests, apzNext_Math_PrefixPatch },
{ zNext_TemplateName, zNext_TemplateList, { zNext_TemplateName, zNext_TemplateList,
apzNext_TemplateMachs, apzNext_TemplateMachs,
NEXT_TEMPLATE_TEST_CT, FD_MACH_ONLY, NEXT_TEMPLATE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aNext_TemplateTests, apzNext_TemplatePatch }, aNext_TemplateTests, apzNext_TemplatePatch },
{ zNext_VolitileName, zNext_VolitileList, { zNext_VolitileName, zNext_VolitileList,
apzNext_VolitileMachs, apzNext_VolitileMachs,
NEXT_VOLITILE_TEST_CT, FD_MACH_ONLY, NEXT_VOLITILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aNext_VolitileTests, apzNext_VolitilePatch }, aNext_VolitileTests, apzNext_VolitilePatch },
{ zNext_Wait_UnionName, zNext_Wait_UnionList, { zNext_Wait_UnionName, zNext_Wait_UnionList,
......
...@@ -611,8 +611,11 @@ fix = { ...@@ -611,8 +611,11 @@ fix = {
hackname = arm_wchar; hackname = arm_wchar;
files = stdlib.h; files = stdlib.h;
select = "#[ \t]*define[ \t]*__wchar_t"; select = "#[ \t]*define[ \t]*__wchar_t";
sed = "s/\\(#[ \t]*ifndef[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/";
sed = "s/\\(#[ \t]*define[ \t]*\\)__wchar_t/\\1_GCC_WCHAR_T/"; c_fix = format;
c_fix_arg = "%1_GCC_WCHAR_T";
c_fix_arg = "(#[ \t]*(ifndef|define)[ \t]+)__wchar_t";
test_text = test_text =
"# ifndef \t __wchar_t /* we don't have wchar_t yet, ... */\n" "# ifndef \t __wchar_t /* we don't have wchar_t yet, ... */\n"
"# define __wchar_t short\n" "# define __wchar_t short\n"
...@@ -651,6 +654,7 @@ fix = { ...@@ -651,6 +654,7 @@ fix = {
files = tinfo.h; files = tinfo.h;
select = "#[ \t]*define[ \t]+bool[ \t]"; select = "#[ \t]*define[ \t]+bool[ \t]";
bypass = "we must use the C\\+\\+ compiler's type";
c_fix = format; c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
...@@ -667,6 +671,7 @@ fix = { ...@@ -667,6 +671,7 @@ fix = {
files = tinfo.h; files = tinfo.h;
select = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;"; select = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;";
bypass = "we must use the C\\+\\+ compiler's type";
c_fix = format; c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
...@@ -684,6 +689,12 @@ fix = { ...@@ -684,6 +689,12 @@ fix = {
* properly in most cases, they don't allow you to take a pointer to the * properly in most cases, they don't allow you to take a pointer to the
* "something" being modified. To get around this limitation, change these * "something" being modified. To get around this limitation, change these
* statements to be of the form '#define something _FOOsomething'. * statements to be of the form '#define something _FOOsomething'.
*
* sed ain't egrep, lesson 2463: sed can use self-referential
* regular expressions. In the substitute expression below,
* "\\1" and "\\2" refer to subexpressions found earlier in the
* same match. So, we continue to use sed. "extern_prefix" will
* be a rare match anyway...
*/ */
fix = { fix = {
hackname = bad_lval; hackname = bad_lval;
...@@ -1096,7 +1107,10 @@ fix = { ...@@ -1096,7 +1107,10 @@ fix = {
hackname = hpux_systime; hackname = hpux_systime;
files = sys/time.h; files = sys/time.h;
select = "^extern struct sigevent;"; select = "^extern struct sigevent;";
sed = "s/^extern struct sigevent;/struct sigevent;/";
c_fix = format;
c_fix_arg = "struct sigevent;";
test_text = 'extern struct sigevent;'; test_text = 'extern struct sigevent;';
}; };
...@@ -1210,10 +1224,9 @@ fix = { ...@@ -1210,10 +1224,9 @@ fix = {
bypass = "ifndef[ \t]+FLT_MIN"; bypass = "ifndef[ \t]+FLT_MIN";
c_fix = format; c_fix = format;
c_fix_arg = "#ifndef %1\n%0#endif\n"; c_fix_arg = "#ifndef %1\n%0\n#endif";
c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+" c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+"
"((FLT|DBL)_(MIN|MAX|DIG))" "((FLT|DBL)_(MIN|MAX|DIG))[ \t].*";
"[ \t][^\n]*\n";
test_text = " #\tdefine\tDBL_DIG \t 0 /* somthin' */"; test_text = " #\tdefine\tDBL_DIG \t 0 /* somthin' */";
}; };
...@@ -1312,10 +1325,14 @@ fix = { ...@@ -1312,10 +1325,14 @@ fix = {
fix = { fix = {
hackname = machine_ansi_h_va_list; hackname = machine_ansi_h_va_list;
files = machine/ansi.h; files = machine/ansi.h;
select = '_BSD_VA_LIST_'; select = "define[ \t]+_BSD_VA_LIST_[ \t]";
bypass = '__builtin_va_list'; bypass = '__builtin_va_list';
sed = "s/\\(_BSD_VA_LIST_[ \t][ \t]*\\).*$/\\1__builtin_va_list/"; c_fix = format;
c_fix_arg = "%1__builtin_va_list";
c_fix_arg = "(define[ \t]+_BSD_VA_LIST_[ \t]+).*";
test_text = " # define _BSD_VA_LIST_\tchar**";
}; };
...@@ -1326,11 +1343,10 @@ fix = { ...@@ -1326,11 +1343,10 @@ fix = {
hackname = machine_name; hackname = machine_name;
c_test = machine_name; c_test = machine_name;
c_fix = machine_name; c_fix = machine_name;
test_text = test_text = "/* MACH_DIFF: */\n"
"#if /* MACH_DIFF: */ \\\n" "#if defined( i386 )"
"\t defined( i386 ) \\\n" " || defined( sparc )"
"\t|| defined( sparc ) /*\n" "\n/* no uniform test, so be careful :-) */";
"no uniform test, so be careful :-) */";
}; };
...@@ -1347,7 +1363,7 @@ fix = { ...@@ -1347,7 +1363,7 @@ fix = {
hackname = math_exception; hackname = math_exception;
files = math.h; files = math.h;
select = "struct exception"; select = "struct exception";
bypass = "We have a problem when using C\\+\\+"; bypass = 'We have a problem when using C\+\+';
c_fix = wrap; c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n" c_fix_arg = "#ifdef __cplusplus\n"
...@@ -1361,6 +1377,13 @@ fix = { ...@@ -1361,6 +1377,13 @@ fix = {
test_text = "typedef struct exception t_math_exception;"; test_text = "typedef struct exception t_math_exception;";
}; };
/*
* This looks pretty broken to me. ``dbl_max_def'' will contain
* "define DBL_MAX " at the start, when what we really want is just
* the value portion. Can't figure out how to write a test case
* for this either :-(
*/
fix = { fix = {
hackname = math_huge_val_from_dbl_max; hackname = math_huge_val_from_dbl_max;
files = math.h; files = math.h;
...@@ -1387,16 +1410,21 @@ fix = { ...@@ -1387,16 +1410,21 @@ fix = {
"\tfi"; "\tfi";
}; };
/* /*
* In any case, put #ifndef .. #endif around #define HUGE_VAL in math.h. * In any case, put #ifndef .. #endif around #define HUGE_VAL in math.h.
*/ */
fix = { fix = {
hackname = math_huge_val_ifndef; hackname = math_huge_val_ifndef;
files = math.h;
files = math/math.h; files = math/math.h;
select = "define[ \t]*HUGE_VAL"; select = "define[ \t]+HUGE_VAL";
sed = "/define[ \t]HUGE_VAL[ \t]/i\\\n#ifndef HUGE_VAL\n"; c_fix = format;
sed = "/define[ \t]HUGE_VAL[ \t]/a\\\n#endif\n"; c_fix_arg = "#ifndef HUGE_VAL\n%0\n#endif";
c_fix_arg = "^[ \t]*#[ \t]*define[ \t]+HUGE_VAL[ \t].*";
test_text = "# define\tHUGE_VAL 3.4e+40";
}; };
...@@ -1457,11 +1485,11 @@ fix = { ...@@ -1457,11 +1485,11 @@ fix = {
fix = { fix = {
hackname = news_os_recursion; hackname = news_os_recursion;
files = stdlib.h; files = stdlib.h;
select = "#include <stdlib.h>"; select = '#include <stdlib\.h>';
sed = "/^#include <stdlib.h>/i\\\n"
"#ifdef BOGUS_RECURSION\n"; c_fix = format;
sed = "/^#include <stdlib.h>/a\\\n" c_fix_arg = "#ifdef BOGUS_RECURSION\n%0\n#endif";
"#endif\n"; test_text = "#include <stdlib.h>";
}; };
...@@ -1470,32 +1498,32 @@ fix = { ...@@ -1470,32 +1498,32 @@ fix = {
* These conflict with the built-in functions. * These conflict with the built-in functions.
*/ */
fix = { fix = {
hackname = next_math_prefix; hackname = next_math_prefix;
files = ansi/math.h; files = ansi/math.h;
select = "^extern.*double.*__const__.*"; select = "^extern[ \t]+double[ \t]+__const__[ \t]";
c_fix = format;
c_fix_arg = "extern double %1(";
c_fix_arg = "^extern[ \t]+double[ \t]+__const__[ \t]+([a-z]+)\\(";
sed = "/^extern.*double.*__const__.*sqrt(/s/__const__//"; test_text = "extern\tdouble\t__const__\tmumble();";
sed = "/^extern.*double.*__const__.*fabs(/s/__const__//";
sed = "/^extern.*double.*__const__.*cos(/s/__const__//";
sed = "/^extern.*double.*__const__.*hypot(/s/__const__//";
sed = "/^extern.*double.*__const__.*sin(/s/__const__//";
}; };
/* /*
* NeXT 3.2 uses the word "template" as a parameter for some * NeXT 3.2 uses the word "template" as a parameter for some
* functions. GCC reports an invalid use of a reserved key word * functions. GCC reports an invalid use of a reserved key word
* with the built-in functions. NeXT 3.2 includes the keyword * with the built-in functions.
* volatile in the prototype for abort(). This conflicts with
* the built-in definition.
*/ */
fix = { fix = {
hackname = next_template; hackname = next_template;
files = bsd/libc.h; files = bsd/libc.h;
select = template; select = "[ \t]template\\)";
sed = '/\(.*template\)/s/template//'; c_fix = format;
sed = "/extern.*volatile.*void.*abort/s/volatile//"; c_fix_arg = "(%1)";
c_fix_arg = "\\(([^)]*)[ \t]template\\)";
test_text = "extern mumble( char * template); /* fix */";
}; };
...@@ -1506,10 +1534,13 @@ fix = { ...@@ -1506,10 +1534,13 @@ fix = {
fix = { fix = {
hackname = next_volitile; hackname = next_volitile;
files = ansi/stdlib.h; files = ansi/stdlib.h;
select = volatile; select = "^extern[ \t]+volatile[ \t]+void[ \t]";
c_fix = format;
c_fix_arg = "extern void %1(";
c_fix_arg = "^extern[ \t]+volatile[ \t]+void[ \t]+(exit|abort)\\(";
sed = "/extern.*volatile.*void.*exit/s/volatile//"; test_text = "extern\tvolatile\tvoid\tabort();";
sed = "/extern.*volatile.*void.*abort/s/volatile//";
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment