diff options
author | Jessica Clarke <jrtc27@FreeBSD.org> | 2025-08-07 00:10:18 +0000 |
---|---|---|
committer | Jessica Clarke <jrtc27@FreeBSD.org> | 2025-08-07 00:10:18 +0000 |
commit | 650bcf5b6be222184d6258c303bdce7434d2f041 (patch) | |
tree | b727915f00940b1c0d2365f38d8524ae10450804 /sys/net/toeplitz.h | |
parent | 4de9547f322bb26f146ddd4139610e927afc5ef0 (diff) |
MD_OBJ_ENTRY is a list of members, possibly empty, to include in
Obj_Entry. By including the semicolon here, in the case that it's empty,
we end up with a duplicate semicolon. In the case that it's not empty,
whether there's a duplicate depends on each architecture's definition,
but they all in fact put a semicolon after every member, so there is
also a duplicate semicolon there. This is invalid C syntax, although
both GCC and Clang accept it, treating it only as a pedantic warning,
but there is no need for us to rely on that, and downstream it masked a
missing semicolon for an added field, but only on architectures where
MD_OBJ_ENTRY is empty, leading to conditional compilation failure for
something that should have been detected as an unconditional error.
Note that PCPU_MD_FIELDS, which this is based on, follows a different
style. There, every architecture defines at least one member, and there
is a semicolon after PCPU_MD_FIELDS in sys/sys/pcpu.h, but every
architecture makes sure to not put a semicolon after the final member in
its definition of the macro. This is not a pattern we can adhere to here
though given not all architectures add members.
Fixes: 06db20ffeca9 ("rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry")
Diffstat (limited to 'sys/net/toeplitz.h')
0 files changed, 0 insertions, 0 deletions