Thanks Hans
On 16/11/2020 09:33, Hans de Goede wrote:
Hi,
On 11/16/20 12:04 AM, Mark Pearson wrote:
<snip>
I believe there's no reason to remove the comma from there, and in fact,
having a comma after the last entry in an array, enum, etc. seems to be
the preferred.
OK.
Have to be honest - I struggle to know when comma's are needed on the last entry and when they aren't (I've had similar corrections in other cases both ways :)). I do seem to have a knack of getting it consistently wrong....
Do the rule of thumb here is, if the last element is a terminating element,
e.g. NULL or {} or foo_number_of_foo_types in an enum foo declaration then
there should not be a comma after the last element. The reason for is is
that in case case new entries will be added one line above the last element.
If there is no terminating element (e.g. because ARRAY_SIZE is always used
on the array). Then the last element should end with a comma. The reason for
this is so that the unified diff of a patch adding a new element does not
have -++ lines, as would be necessary when the comma is missing (-+ to add
the comma, plus one more + for the new element).
I hope this helps explain.
It does - makes complete sense.
I expect you will send out a v4 of the entire set addressing all current
remarks?
Absolutely. Hopefully will get that out soon but I'm going to take a bit
longer on it as I was pretty disappointed with myself for some of the
things that slipped into the last set. I'll aim to get a cleaner set out
for v4.
Regards,
Hans
Thanks
Mark