summaryrefslogtreecommitdiffstats
path: root/fixincludes
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-11-18 10:33:30 -0800
committerNathan Sidwell <nathan@acm.org>2020-11-18 10:33:30 -0800
commit92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b (patch)
tree50a52e925439420ec31cd6a9220abf97042000db /fixincludes
parentpreprocessor: C++ module-directives (diff)
downloadgcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.tar.gz
gcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.tar.bz2
gcc-92648faa1cb2b28685f3b3dccfdfc4b1ed2c5a7b.tar.xz
aix: Fixinclude
This fixes an ODR violation in the AIX headers that is detected by C++ modules. While unnamed structs with typedef names for linkage purposes are accepted, this case is an anonymous struct without such a typedef name -- the typedef is attached to the pointer-to-struct type. Fixed by naming the struct. fixincludes/ * inclhack.def (aix_physaddr_t): New. * fixincl.x: Regenerated.
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/fixincl.x53
-rw-r--r--fixincludes/inclhack.def14
2 files changed, 62 insertions, 5 deletions
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 758d5620641..21439652bce 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
2 * 2 *
3 * DO NOT EDIT THIS FILE (fixincl.x) 3 * DO NOT EDIT THIS FILE (fixincl.x)
4 * 4 *
5 * It has been AutoGen-ed October 3, 2020 at 11:40:52 PM by AutoGen 5.18 5 * It has been AutoGen-ed October 21, 2020 at 10:43:22 AM by AutoGen 5.18.16
6 * From the definitions inclhack.def 6 * From the definitions inclhack.def
7 * and the template file fixincl 7 * and the template file fixincl
8 */ 8 */
9/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Oct 3 23:40:52 UTC 2020 9/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 21 10:43:22 EDT 2020
10 * 10 *
11 * You must regenerate it. Use the ./genfixes script. 11 * You must regenerate it. Use the ./genfixes script.
12 * 12 *
@@ -15,7 +15,7 @@
15 * certain ANSI-incompatible system header files which are fixed to work 15 * certain ANSI-incompatible system header files which are fixed to work
16 * correctly with ANSI C and placed in a directory that GNU C will search. 16 * correctly with ANSI C and placed in a directory that GNU C will search.
17 * 17 *
18 * This file contains 259 fixup descriptions. 18 * This file contains 260 fixup descriptions.
19 * 19 *
20 * See README for more information. 20 * See README for more information.
21 * 21 *
@@ -1249,6 +1249,43 @@ static const char* apzAix_Rwlock_Initializer_1Patch[] = {
1249 1249
1250/* * * * * * * * * * * * * * * * * * * * * * * * * * 1250/* * * * * * * * * * * * * * * * * * * * * * * * * *
1251 * 1251 *
1252 * Description of Aix_Physadr_T fix
1253 */
1254tSCC zAix_Physadr_TName[] =
1255 "aix_physadr_t";
1256
1257/*
1258 * File name selection pattern
1259 */
1260tSCC zAix_Physadr_TList[] =
1261 "sys/types.h\0";
1262/*
1263 * Machine/OS name selection pattern
1264 */
1265tSCC* apzAix_Physadr_TMachs[] = {
1266 "*-*-aix*",
1267 (const char*)NULL };
1268
1269/*
1270 * content selection pattern - do fix if pattern found
1271 */
1272tSCC zAix_Physadr_TSelect0[] =
1273 "typedef[ \t]*struct[ \t]*([{][^}]*[}][ \t]*\\*[ \t]*physadr_t;)";
1274
1275#define AIX_PHYSADR_T_TEST_CT 1
1276static tTestDesc aAix_Physadr_TTests[] = {
1277 { TT_EGREP, zAix_Physadr_TSelect0, (regex_t*)NULL }, };
1278
1279/*
1280 * Fix Command Arguments for Aix_Physadr_T
1281 */
1282static const char* apzAix_Physadr_TPatch[] = {
1283 "format",
1284 "typedef struct __physadr_s %1",
1285 (char*)NULL };
1286
1287/* * * * * * * * * * * * * * * * * * * * * * * * * *
1288 *
1252 * Description of Aix_Pthread fix 1289 * Description of Aix_Pthread fix
1253 */ 1290 */
1254tSCC zAix_PthreadName[] = 1291tSCC zAix_PthreadName[] =
@@ -10521,9 +10558,9 @@ static const char* apzX11_SprintfPatch[] = {
10521 * 10558 *
10522 * List of all fixes 10559 * List of all fixes
10523 */ 10560 */
10524#define REGEX_COUNT 297 10561#define REGEX_COUNT 298
10525#define MACH_LIST_SIZE_LIMIT 187 10562#define MACH_LIST_SIZE_LIMIT 187
10526#define FIX_COUNT 259 10563#define FIX_COUNT 260
10527 10564
10528/* 10565/*
10529 * Enumerate the fixes 10566 * Enumerate the fixes
@@ -10555,6 +10592,7 @@ typedef enum {
10555 AIX_MUTEX_INITIALIZER_1_FIXIDX, 10592 AIX_MUTEX_INITIALIZER_1_FIXIDX,
10556 AIX_COND_INITIALIZER_1_FIXIDX, 10593 AIX_COND_INITIALIZER_1_FIXIDX,
10557 AIX_RWLOCK_INITIALIZER_1_FIXIDX, 10594 AIX_RWLOCK_INITIALIZER_1_FIXIDX,
10595 AIX_PHYSADR_T_FIXIDX,
10558 AIX_PTHREAD_FIXIDX, 10596 AIX_PTHREAD_FIXIDX,
10559 AIX_STDINT_1_FIXIDX, 10597 AIX_STDINT_1_FIXIDX,
10560 AIX_STDINT_2_FIXIDX, 10598 AIX_STDINT_2_FIXIDX,
@@ -10921,6 +10959,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
10921 AIX_RWLOCK_INITIALIZER_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, 10959 AIX_RWLOCK_INITIALIZER_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
10922 aAix_Rwlock_Initializer_1Tests, apzAix_Rwlock_Initializer_1Patch, 0 }, 10960 aAix_Rwlock_Initializer_1Tests, apzAix_Rwlock_Initializer_1Patch, 0 },
10923 10961
10962 { zAix_Physadr_TName, zAix_Physadr_TList,
10963 apzAix_Physadr_TMachs,
10964 AIX_PHYSADR_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
10965 aAix_Physadr_TTests, apzAix_Physadr_TPatch, 0 },
10966
10924 { zAix_PthreadName, zAix_PthreadList, 10967 { zAix_PthreadName, zAix_PthreadList,
10925 apzAix_PthreadMachs, 10968 apzAix_PthreadMachs,
10926 AIX_PTHREAD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, 10969 AIX_PTHREAD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 47eb236586c..80c9adfb07c 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -720,6 +720,20 @@ fix = {
720 "{ \\\\\n"; 720 "{ \\\\\n";
721}; 721};
722 722
723
724/* On AIX 'typedef struct {<stuff>} * physadr_t;' needs to give the struct a
725 name for linkage purposes. Fortunately it is on exactly one
726 line. */
727fix = {
728 hackname = aix_physadr_t;
729 mach = "*-*-aix*";
730 files = sys/types.h;
731 select = "typedef[ \t]*struct[ \t]*([{][^}]*[}][ \t]*\\*[ \t]*physadr_t;)";
732 c_fix = format;
733 c_fix_arg = "typedef struct __physadr_s %1";
734 test_text = "typedef struct __physadr_s {";
735};
736
723/* 737/*
724 * pthread.h on AIX 4.3.3 tries to define a macro without whitspace 738 * pthread.h on AIX 4.3.3 tries to define a macro without whitspace
725 * which violates a requirement of ISO C. 739 * which violates a requirement of ISO C.