diff options
| author | Paul Eggert | 2013-06-21 13:11:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-06-21 13:11:44 -0700 |
| commit | fbe9e0b9fb6a250674e7619e9ba794e74ff5f0bc (patch) | |
| tree | 7b1836faca02f39413afec531c2ae467898523f5 /src/ChangeLog | |
| parent | cad5d1cb5af7210154814b60825576d14740158f (diff) | |
| download | emacs-fbe9e0b9fb6a250674e7619e9ba794e74ff5f0bc.tar.gz emacs-fbe9e0b9fb6a250674e7619e9ba794e74ff5f0bc.zip | |
Use C99-style flexible array members if available.
This avoids some subtle aliasing issues, which typically
aren't a problem with GCC but may be a problem elsewhere.
* lib-src/ebrowse.c (struct member, struct alias, struct sym):
Use FLEXIBLE_ARRAY_MEMBER.
(add_sym, add_member, make_namespace, register_namespace_alias):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/alloc.c (sdata): New typedef, replacing the old struct sdata.
It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
In either case, it uses a flexible array member rather than
the old struct hack. All uses changed.
(SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
Adjust to sdata reorganization.
* src/alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
Use offsetof (struct, flex_array_member), not sizeof (struct), as
that ports better to pre-C99 non-GCC.
* src/chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
as the latter has changed.
* src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
and port better to pre-C99 GCC.
* src/image.c (struct xpm_cached_color):
* src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
(struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
Use FLEXIBLE_ARRAY_MEMBER.
* src/lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
Move decl to top level so it gets checked against implementation.
(CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
* src/w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4e52f5b2818..4821f5fb7eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,31 @@ | |||
| 1 | 2013-06-21 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Use C99-style flexible array members if available. | ||
| 4 | This avoids some subtle aliasing issues, which typically | ||
| 5 | aren't a problem with GCC but may be a problem elsewhere. | ||
| 6 | * alloc.c (sdata): New typedef, replacing the old struct sdata. | ||
| 7 | It is a struct if GC_CHECK_STRING_BYTES, a union otherwise. | ||
| 8 | In either case, it uses a flexible array member rather than | ||
| 9 | the old struct hack. All uses changed. | ||
| 10 | (SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]: | ||
| 11 | Adjust to sdata reorganization. | ||
| 12 | * alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect): | ||
| 13 | Use offsetof (struct, flex_array_member), not sizeof (struct), as | ||
| 14 | that ports better to pre-C99 non-GCC. | ||
| 15 | * chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table): | ||
| 16 | Use CHAR_TABLE_STANDARD_SLOTS rather than its definition, | ||
| 17 | as the latter has changed. | ||
| 18 | * conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c, | ||
| 19 | and port better to pre-C99 GCC. | ||
| 20 | * image.c (struct xpm_cached_color): | ||
| 21 | * lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector) | ||
| 22 | (struct Lisp_Char_Table, struct Lisp_Sub_Char_Table): | ||
| 23 | Use FLEXIBLE_ARRAY_MEMBER. | ||
| 24 | * lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]: | ||
| 25 | Move decl to top level so it gets checked against implementation. | ||
| 26 | (CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change. | ||
| 27 | * w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h. | ||
| 28 | |||
| 1 | 2013-06-20 Paul Eggert <eggert@cs.ucla.edu> | 29 | 2013-06-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 30 | ||
| 3 | * syntax.c: Integer cleanups. | 31 | * syntax.c: Integer cleanups. |