On Tue, Apr 09, 2019 at 10:05:00AM -0400, David Malcolm wrote:
> > Thinking aloud, maybe c-format.c could check for some of
> > these?  (provided they're at a suitable callsite).
> > 
> > We're already statically checking for valid format codes/types for
> > strings at callsites of decls with ATTRIBUTE_GCC_DIAG; maybe that
> > test
> > could also check for things like trailing whitespace within the
> > string?
> > 
> > Wouldn't help for the LINK_SPEC things, though.
> 
> FWIW, I *think* the substring location stuff retains enough information
> for such an extension of c-format.c to detect bad concatenation cases
> like:
> 
> "word"
> "another word"

I guess you're right.  The question is if something like this would be
useful even for other users.  In that case, as a style warning, it probably
shouldn't be in -Wall or -Wextra (talking about the no or double spaces on
string concatenations from separate lines).
For the no period at the end of diagnostics it would need to be keyed on
gcc-internal-format only of course.

        Jakub

Reply via email to