From 1d10941673c5b7592235262a11ef1280121914c7 Mon Sep 17 00:00:00 2001 From: Nathanael Nerode Date: Mon, 25 Aug 2003 21:54:14 +0000 Subject: [PATCH] inclhack.def (svr4_sighandler_type): New fix, ported from fixinc.svr4. * fixinc/inclhack.def (svr4_sighandler_type): New fix, ported from fixinc.svr4. * fixinc/fixincl.x: Regenerate. * fixinc/tests/base/sys/signal.h: Regenerate. From-SVN: r70786 --- gcc/ChangeLog | 7 ++++ gcc/fixinc/fixincl.x | 51 +++++++++++++++++++++++++++--- gcc/fixinc/inclhack.def | 16 ++++++++++ gcc/fixinc/tests/base/sys/signal.h | 7 ++++ 4 files changed, 76 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e23a0e2e6c0..a30a9eceeea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-08-25 Nathanael Nerode + + * fixinc/inclhack.def (svr4_sighandler_type): New fix, ported + from fixinc.svr4. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/sys/signal.h: Regenerate. + 2003-08-25 Ulrich Weigand * combine.c (simplify_comparison): Re-enable widening of comparisons diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 5b689dfcd00..c8ac74a7920 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 Sunday August 17, 2003 at 01:31:26 AM EDT + * It has been AutoGen-ed Sunday August 24, 2003 at 03:26:44 PM EDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Sun Aug 17 01:31:26 EDT 2003 +/* DO NOT CVS-MERGE THIS FILE, EITHER Sun Aug 24 15:26:44 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 157 fixup descriptions. + * This file contains 158 fixup descriptions. * * See README for more information. * @@ -4980,6 +4980,41 @@ static const char* apzSvr4_ProfilPatch[] = { "profil(unsigned short *, size_t, int, unsigned int)", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Svr4_Sighandler_Type fix + */ +tSCC zSvr4_Sighandler_TypeName[] = + "svr4_sighandler_type"; + +/* + * File name selection pattern + */ +tSCC zSvr4_Sighandler_TypeList[] = + "|sys/signal.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSvr4_Sighandler_TypeMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSvr4_Sighandler_TypeSelect0[] = + "void *\\(\\*\\)\\(\\)"; + +#define SVR4_SIGHANDLER_TYPE_TEST_CT 1 +static tTestDesc aSvr4_Sighandler_TypeTests[] = { + { TT_EGREP, zSvr4_Sighandler_TypeSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Svr4_Sighandler_Type + */ +static const char* apzSvr4_Sighandler_TypePatch[] = { + "format", + "void (*)(int)", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Svr4_Undeclared_Getrnge fix @@ -6236,9 +6271,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 177 +#define REGEX_COUNT 178 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 157 +#define FIX_COUNT 158 /* * Enumerate the fixes @@ -6368,6 +6403,7 @@ typedef enum { SVR4_GETCWD_FIXIDX, SVR4_KRNL_FIXIDX, SVR4_PROFIL_FIXIDX, + SVR4_SIGHANDLER_TYPE_FIXIDX, SVR4_UNDECLARED_GETRNGE_FIXIDX, SYSV68_STRING_FIXIDX, SYSZ_STDLIB_FOR_SUN_FIXIDX, @@ -7024,6 +7060,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSvr4_ProfilTests, apzSvr4_ProfilPatch, 0 }, + { zSvr4_Sighandler_TypeName, zSvr4_Sighandler_TypeList, + apzSvr4_Sighandler_TypeMachs, + SVR4_SIGHANDLER_TYPE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSvr4_Sighandler_TypeTests, apzSvr4_Sighandler_TypePatch, 0 }, + { zSvr4_Undeclared_GetrngeName, zSvr4_Undeclared_GetrngeList, apzSvr4_Undeclared_GetrngeMachs, SVR4_UNDECLARED_GETRNGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 8dd5f1c1598..4eade8cb3fd 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2978,6 +2978,22 @@ fix = { }; #endif + +/* + * Correct types for signal handler constants like SIG_DFL; they might be + * void (*) (), and should be void (*) (int). C++ doesn't like the + * old style. + */ +fix = { + hackname = svr4_sighandler_type; + files = sys/signal.h; + select = 'void *\(\*\)\(\)'; + c_fix = format; + c_fix_arg = "void (*)(int)"; + test_text = "#define SIG_DFL (void(*)())0\n" + "#define SIG_IGN (void (*)())0\n"; +}; + /* * Put storage class at start of decl, to avoid warning. */ diff --git a/gcc/fixinc/tests/base/sys/signal.h b/gcc/fixinc/tests/base/sys/signal.h index 9e4fdb85605..7a9ecb113cd 100644 --- a/gcc/fixinc/tests/base/sys/signal.h +++ b/gcc/fixinc/tests/base/sys/signal.h @@ -21,3 +21,10 @@ void (*signal(...))(...); void (*signal())(); #endif #endif /* SUN_SIGNAL_CHECK */ + + +#if defined( SVR4_SIGHANDLER_TYPE_CHECK ) +#define SIG_DFL (void (*)(int))0 +#define SIG_IGN (void (*)(int))0 + +#endif /* SVR4_SIGHANDLER_TYPE_CHECK */