]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
include: struct members must be added in ascending order by offset
authorNick Alcock <nick.alcock@oracle.com>
Sun, 9 Nov 2025 14:39:03 +0000 (14:39 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 9 Dec 2025 13:02:31 +0000 (13:02 +0000)
We've thrown ECTF_DESCENDING for some time if this wasn't true.  (In
theory this restriction could be lifted later on if necessary, but in
practice since this means adding the members in a different order from
their C declaration, this seems unlikely ever to be something anyone
would want to do.)

include/

* ctf-api.h (ctf_add_member): You cannot add struct members
          backwards any more.

include/ctf-api.h

index e6c11164a2c2e7c6e5c1396fdd2693133184f9de..c85427ad4bc37c26504307c5cd98f3bd0b335bd3 100644 (file)
@@ -1024,7 +1024,7 @@ extern ctf_ret_t ctf_add_enumerator (ctf_dict_t *, ctf_id_t, const char *, int64
 /* Add a member to a struct or union, either at the next available offset (with
    suitable padding for the alignment) or at a specific offset, and possibly
    with a specific encoding (creating a slice for you).  Offsets need not be
-   unique, and need not be added in ascending order.  ctf_add_member_bitfield
+   unique, but must be added in ascending order.  ctf_add_member_bitfield
    with a nonzero bit_width will fail unless the struct was created with
    CTF_ADD_STRUCT_BITFIELDS.  */