Damien Miller
2021-Jun-04 06:20 UTC
[PATCH v2 2/2] Remove trailing semicolon after RB_GENERATE_STATIC
thanks - applied as e76069191 On Thu, 13 May 2021, Michael Forney wrote:> This expands to a series of function definitions, so the semicolon is > not necessary (in fact, it is not allowed in ISO C). > --- > krl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/krl.c b/krl.c > index 5612e774..c75279f9 100644 > --- a/krl.c > +++ b/krl.c > @@ -61,7 +61,7 @@ struct revoked_serial { > }; > static int serial_cmp(struct revoked_serial *a, struct revoked_serial *b); > RB_HEAD(revoked_serial_tree, revoked_serial); > -RB_GENERATE_STATIC(revoked_serial_tree, revoked_serial, tree_entry, serial_cmp); > +RB_GENERATE_STATIC(revoked_serial_tree, revoked_serial, tree_entry, serial_cmp) > > /* Tree of key IDs */ > struct revoked_key_id { > @@ -70,7 +70,7 @@ struct revoked_key_id { > }; > static int key_id_cmp(struct revoked_key_id *a, struct revoked_key_id *b); > RB_HEAD(revoked_key_id_tree, revoked_key_id); > -RB_GENERATE_STATIC(revoked_key_id_tree, revoked_key_id, tree_entry, key_id_cmp); > +RB_GENERATE_STATIC(revoked_key_id_tree, revoked_key_id, tree_entry, key_id_cmp) > > /* Tree of blobs (used for keys and fingerprints) */ > struct revoked_blob { > @@ -80,7 +80,7 @@ struct revoked_blob { > }; > static int blob_cmp(struct revoked_blob *a, struct revoked_blob *b); > RB_HEAD(revoked_blob_tree, revoked_blob); > -RB_GENERATE_STATIC(revoked_blob_tree, revoked_blob, tree_entry, blob_cmp); > +RB_GENERATE_STATIC(revoked_blob_tree, revoked_blob, tree_entry, blob_cmp) > > /* Tracks revoked certs for a single CA */ > struct revoked_certs { > -- > 2.31.1 > > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
David Newall
2021-Jun-04 08:08 UTC
[PATCH v2 2/2] Remove trailing semicolon after RB_GENERATE_STATIC
On Thu, 13 May 2021, Michael Forney wrote:> This expands to a series of function definitions, so the semicolon is > not necessary (in fact, it is not allowed in ISO C).I went looking for that, and failed to find it.? The best I could find says otherwise.? ISO/IEC 9899:2017 (C17): Section 6.8.3 Expression and null statements specifically allows a null statement (as you'd expect given the section name). It must be a new revision.? When did the null statement become disallowed?? Reference, please. If the null statements are still allowed, I urge that the patch be reverted as it would then be mere noise in the change history, a distraction at best, and a source of errors at worst. The benefit of the semi-colon (if allowed) is that it makes explicit that the macro is a psuedo-statement.? Also, if the macro is redefined to produce an expression that is not a (terminated) statement, the program will no longer compile. In case you hadn't noticed, I look unfavourably on trivial, janitorial patches.