On Thu, Oct 10, 2024 at 04:54:36PM +0100, Gavin Smith wrote:
> On Thu, Oct 10, 2024 at 09:00:32AM +0200, Patrice Dumas wrote:
> > Hello,
> > 
> > There are warnings with -Wmissing-field-initializers for info/variables.c
> > VARIABLE_ALIST info_variables where the where_set field is never
> > explicitely set.  This code is from Gavin, and is by design, as there
> > is this comment:
> > /* Note that the 'where_set' field of each element in the array is
> >    not given and defaults to 0. */
> > 
> > I would have put 0 there myself if I had written that code, but omitting
> > fields seems to me to be also ok if it is documented as it is here.
> > However, the warning is also interesting to set as in other cases the
> > missing fields may be an overlook, and having false positives is a pain.

...

> Another idea is to use preprocessor macros to generate parts of the
> initialiser, which macros would add the ", 0" automatically.  There
> could be e.g. ON_OFF_VAR so instead of writing

I used macros in commit f6b2480e99 (today), in a slightly different
way to my original proposal.


Reply via email to