Hi Joseph,

On Thu, Sep 11, 2025 at 03:42:20PM +0000, Joseph Myers wrote:
> On Thu, 11 Sep 2025, Alejandro Colomar wrote:
> 
> > Warn about this:
> > 
> >     void f(int x; int x; int x);
> > 
> > This would allow eventually adding another semicolon in function
> > prototypes to separate a different feature.
> 
> I don't think that's a plausible future addition.  The small visual 
> difference between comma and semicolon is one of the reasons people have 
> given for objecting to this feature; adding extra features with multiple 
> semicolons seems even more confusing, quite apart from being incompatible 
> with the existing extension.

Yeah, I also expect it to be unlikely for now.  I just wanted to leave
the door open, just in case we find it useful later.  To be clear,
I don't think it's useful in any way, though.

> > So, make multiple lists of forward declarations of parameters
> > obsolescent, and produce a new diagnostic,
> > -Wmultiple-parameter-fwd-decl-lists, which diagnoses uses of this
> > obsolescent syntax.
> 
> I'm dubious of obsolescence here.  Restricting to a single forward 
> declaration list is one of many possible design choices for a subset of 
> the feature to consider for the standard; it's a reasonable subset choice, 
> but hardly a unique one.  If the feature were accepted into C2y with that 
> particular subset, my inclination would be that cases outside that subset 
> (i.e. multiple forward declaration lists) would then (continue to) get a 
> pedwarn-if-pedantic, rather than any stronger form of obsolescence such as 
> warning with -Wextra.  Having an additional option for this particular 
> case is reasonable enough; it's treating it as obsolesence or including it 
> in -Wextra that seems questionable.

Okay, I can reword the commit message to remove any clues of
obsolescence.  We can consider obsolescence if/when we need to do it.

About -Wextra, I think it would be useful.  If people are going to start
using this slightly more often than until now (the Linux man-pages might
help with discovering this obscure feature, as it's now being used in
the SYNOPSIS section of some functions), then it would be useful for
them to remain on the preferred way to use this feature, and this
diagnostic would prevent any accidental use of semicolons to separate
forward declarations.

Anyway, I don't think we'll break much code in -Wextra (and to some
degree, -Wextra is already allowed to break a little bit).


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

Attachment: signature.asc
Description: PGP signature

Reply via email to