From: Bruno Haible Date: Sun, 3 May 2026 06:51:08 +0000 (+0200) Subject: argp: Use the counted_by attribute. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e63ae1335b5fbdc6c6510e30525abbdbc8a60db0;p=thirdparty%2Fgnulib.git argp: Use the counted_by attribute. * lib/argp-help.c (struct hol): Mark the entries fields as counted_by num_entries. Swap these fields (needed for clang, see ). --- diff --git a/ChangeLog b/ChangeLog index af44055e31..84bc54f299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2026-05-03 Bruno Haible + + argp: Use the counted_by attribute. + * lib/argp-help.c (struct hol): Mark the entries fields as counted_by + num_entries. Swap these fields (needed for clang, see + ). + 2026-05-03 Bruno Haible dfa: Remove a redundant forward declaration. diff --git a/lib/argp-help.c b/lib/argp-help.c index 8a3e72e79c..d925336775 100644 --- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -419,11 +419,12 @@ struct hol_cluster /* A list of options for help. */ struct hol { - /* An array of hol_entry's. */ - struct hol_entry *entries; /* The number of entries in this hol. If this field is zero, entries and short_options are undefined. */ unsigned num_entries; + /* An array of hol_entry's. */ + struct hol_entry *entries + _GL_ATTRIBUTE_COUNTED_BY (num_entries); /* A string containing all short options in this HOL. Each entry contains pointers into this string, so the order can't be messed with blindly. */