diff options
| author | Paul Eggert | 2016-09-20 08:30:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-09-20 08:32:15 -0700 |
| commit | d9741b61c8e446de084cc4dc609aaa8e5702118d (patch) | |
| tree | bc7dee77f208e70918e0c15aa91eb728f27b0c47 /src/conf_post.h | |
| parent | 83fbb3a6dd75e01a768cb6b3348b7c947711ee46 (diff) | |
| download | emacs-d9741b61c8e446de084cc4dc609aaa8e5702118d.tar.gz emacs-d9741b61c8e446de084cc4dc609aaa8e5702118d.zip | |
Use flexmembers on IBM XL C for AIX
This removes a workaround where Emacs did not use flexible
array members when compiled with IBM XL C. Instead, avoid
the problem by making the aliasing issues more obvious to
this compiler.
* admin/merge-gnulib: Don’t remove m4/flexmember.m4.
* m4/flexmember.m4: Copy from gnulib.
* configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Remove workaround.
* src/alloc.c (allocate_string_data): Rephrase to avoid aliasing
problem that would otherwise mess up code generated for flexible
array members by IBM XL C for AIX, V12.1.
* src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Remove; now done
by gnulib code.
Diffstat (limited to 'src/conf_post.h')
| -rw-r--r-- | src/conf_post.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/conf_post.h b/src/conf_post.h index 865d0183a57..6d54524b970 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -358,16 +358,6 @@ extern int emacs_setenv_TZ (char const *); | |||
| 358 | #define INLINE_HEADER_BEGIN _GL_INLINE_HEADER_BEGIN | 358 | #define INLINE_HEADER_BEGIN _GL_INLINE_HEADER_BEGIN |
| 359 | #define INLINE_HEADER_END _GL_INLINE_HEADER_END | 359 | #define INLINE_HEADER_END _GL_INLINE_HEADER_END |
| 360 | 360 | ||
| 361 | /* To use the struct hack with N elements, declare the struct like this: | ||
| 362 | struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; }; | ||
| 363 | and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes. | ||
| 364 | IBM xlc 12.1 claims to do C99 but mishandles flexible array members. */ | ||
| 365 | #ifdef __IBMC__ | ||
| 366 | # define FLEXIBLE_ARRAY_MEMBER 1 | ||
| 367 | #else | ||
| 368 | # define FLEXIBLE_ARRAY_MEMBER | ||
| 369 | #endif | ||
| 370 | |||
| 371 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC | 361 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC |
| 372 | into not warning incorrectly about use of an uninitialized variable. */ | 362 | into not warning incorrectly about use of an uninitialized variable. */ |
| 373 | #if defined GCC_LINT || defined lint | 363 | #if defined GCC_LINT || defined lint |