From 5ee5eddb26e6007aaa2fadd19a55d6bc03cb2baa Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Mon, 30 Dec 2019 20:33:17 +0000 Subject: re PR libgomp/93066 (libgomp/target.c:525:46: error: expected expression before ')' token) PR libgomp/93066 * inclhack.def (hpux_c99_inttypes3): Fix defines for INTPTR_MAX and UINTPTR_MAX, and missing define for SIZE_MAX. * fixincl.x: Regenerate. * tests/base/inttypes.h: Update for above fix. From-SVN: r279773 --- fixincludes/ChangeLog | 8 +++++ fixincludes/fixincl.x | 65 ++++++++++++++++++++++++++++++++++++--- fixincludes/inclhack.def | 26 ++++++++++++++++ fixincludes/tests/base/inttypes.h | 17 ++++++++++ 4 files changed, 111 insertions(+), 5 deletions(-) (limited to 'fixincludes') diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 03c2313bd8e..c0abf7c3f62 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,11 @@ +2019-12-30 John David Anglin + + PR libgomp/93066 + * inclhack.def (hpux_c99_inttypes3): Fix defines for INTPTR_MAX + and UINTPTR_MAX, and missing define for SIZE_MAX. + * fixincl.x: Regenerate. + * tests/base/inttypes.h: Update for above fix. + 2019-08-18 C.G. Dogan Iain Sandoe diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index e5ae601eca0..8b9b547e626 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed June 21, 2019 at 09:13:33 PM by AutoGen 5.17.4 + * It has been AutoGen-ed December 30, 2019 at 03:30:20 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jun 21 21:13:33 BST 2019 +/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Dec 30 15:30:20 EST 2019 * * 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 256 fixup descriptions. + * This file contains 257 fixup descriptions. * * See README for more information. * @@ -5147,6 +5147,55 @@ static const char* apzHpux_C99_Inttypes2Patch[] = { sed_cmd_z, "-e", "s@^[ \t]*#[ \t]*define[ \t]*UINT16_C(__c)[ \t]*((unsigned short)(__c))[ \t]*$@#define UINT16_C(__c) (__c)@", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Hpux_C99_Inttypes3 fix + */ +tSCC zHpux_C99_Inttypes3Name[] = + "hpux_c99_inttypes3"; + +/* + * File name selection pattern + */ +tSCC zHpux_C99_Inttypes3List[] = + "inttypes.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzHpux_C99_Inttypes3Machs[] = { + "hppa*-hp-hpux11*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zHpux_C99_Inttypes3Select0[] = + "#define[ \t]INTPTR_MAX[ \t]*\n\ +#define[ \t]UINTPTR_MAX[ \t]*\n"; + +#define HPUX_C99_INTTYPES3_TEST_CT 1 +static tTestDesc aHpux_C99_Inttypes3Tests[] = { + { TT_EGREP, zHpux_C99_Inttypes3Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Hpux_C99_Inttypes3 + */ +static const char* apzHpux_C99_Inttypes3Patch[] = { + "format", + "#undef SIZE_MAX\n\ +#define SIZE_MAX __SIZE_MAX__\n\ +#ifdef __INTPTR_MAX__\n\ +# undef INTPTR_MAX\n\ +# define INTPTR_MAX __INTPTR_MAX__\n\ +# undef INTPTR_MIN\n\ +# define INTPTR_MIN (-INTPTR_MAX - 1)\n\ +#endif\n\ +#ifdef __UINTPTR_MAX__\n\ +# undef UINTPTR_MAX\n\ +# define UINTPTR_MAX __UINTPTR_MAX__\n\ +#endif\n", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Hpux_Ctype_Macros fix @@ -10396,9 +10445,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 295 +#define REGEX_COUNT 296 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 256 +#define FIX_COUNT 257 /* * Enumerate the fixes @@ -10527,6 +10576,7 @@ typedef enum { HPUX_C99_INTPTR_FIXIDX, HPUX_C99_INTTYPES_FIXIDX, HPUX_C99_INTTYPES2_FIXIDX, + HPUX_C99_INTTYPES3_FIXIDX, HPUX_CTYPE_MACROS_FIXIDX, HPUX_EXTERN_ERRNO_FIXIDX, HPUX_HTONL_FIXIDX, @@ -11278,6 +11328,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { HPUX_C99_INTTYPES2_TEST_CT, FD_MACH_ONLY, aHpux_C99_Inttypes2Tests, apzHpux_C99_Inttypes2Patch, 0 }, + { zHpux_C99_Inttypes3Name, zHpux_C99_Inttypes3List, + apzHpux_C99_Inttypes3Machs, + HPUX_C99_INTTYPES3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aHpux_C99_Inttypes3Tests, apzHpux_C99_Inttypes3Patch, 0 }, + { zHpux_Ctype_MacrosName, zHpux_Ctype_MacrosList, apzHpux_Ctype_MacrosMachs, HPUX_CTYPE_MACROS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 3c6b48d26e1..bf136fdaa20 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2587,6 +2587,32 @@ fix = { "# define UINT16_C(__c) ((unsigned short)(__c))\n"; }; +/* + * Fix broken and missing defines in inttypes.h + */ +fix = { + hackname = hpux_c99_inttypes3; + mach = "hppa*-hp-hpux11*"; + files = inttypes.h; + select = "#define[ \t]INTPTR_MAX[ \t]*\n" + "#define[ \t]UINTPTR_MAX[ \t]*\n"; + c_fix = format; + c_fix_arg = "#undef SIZE_MAX\n" + "#define SIZE_MAX __SIZE_MAX__\n" + "#ifdef __INTPTR_MAX__\n" + "# undef INTPTR_MAX\n" + "# define INTPTR_MAX __INTPTR_MAX__\n" + "# undef INTPTR_MIN\n" + "# define INTPTR_MIN (-INTPTR_MAX - 1)\n" + "#endif\n" + "#ifdef __UINTPTR_MAX__\n" + "# undef UINTPTR_MAX\n" + "# define UINTPTR_MAX __UINTPTR_MAX__\n" + "#endif\n"; + test_text = "#define INTPTR_MAX\n" + "#define UINTPTR_MAX\n"; +}; + /* * Fix hpux broken ctype macros */ diff --git a/fixincludes/tests/base/inttypes.h b/fixincludes/tests/base/inttypes.h index 3f556856a41..e2216832666 100644 --- a/fixincludes/tests/base/inttypes.h +++ b/fixincludes/tests/base/inttypes.h @@ -16,3 +16,20 @@ #define UINT32_C(__c) __CONCAT__(__c,u) #endif /* HPUX_C99_INTTYPES_CHECK */ + + +#if defined( HPUX_C99_INTTYPES3_CHECK ) +#undef SIZE_MAX +#define SIZE_MAX __SIZE_MAX__ +#ifdef __INTPTR_MAX__ +# undef INTPTR_MAX +# define INTPTR_MAX __INTPTR_MAX__ +# undef INTPTR_MIN +# define INTPTR_MIN (-INTPTR_MAX - 1) +#endif +#ifdef __UINTPTR_MAX__ +# undef UINTPTR_MAX +# define UINTPTR_MAX __UINTPTR_MAX__ +#endif + +#endif /* HPUX_C99_INTTYPES3_CHECK */ -- cgit v1.2.3