lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master bdeeca5c 5/5: Improve technique to displa


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master bdeeca5c 5/5: Improve technique to display disabled warnings
Date: Tue, 21 Mar 2023 12:34:19 +0100

On Mon, 20 Mar 2023 22:36:55 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> On 6/12/22 17:32, Vadim Zeitlin wrote:
GC> [...]
GC> > a link to my small project which might be handy:
GC> > 
GC> >   https://github.com/vadz/gcc-warnings-tools
GC> > 
GC> > and direct links to the tables generated by it:
GC> > 
GC> >   https://github.com/vadz/gcc-warnings-tools/wiki/gcc-warnings
GC> >   https://github.com/vadz/gcc-warnings-tools/wiki/all-gcc-warnings
GC> [...]
GC> > warnings added in a new gcc release. E.g., after just updating the pages
GC> > above for gcc 12, looking at the changes you can see that it added the
GC> > following new warnings not enabled by -Wall (or by default): 
array-compare,
GC> > infinite-recursion, openacc-parallelism, trivial-auto-var-init and
GC> > use-after-free, some of which might be useful to explore when lmi starts
GC> > using it.
GC> 
GC> I've explicitly enabled these two:
GC>   openacc-parallelism
GC>   trivial-auto-var-init
GC> and they engender no new diagnostic anywhere in lmi.

 IMO the first one doesn't make much sense without using OpenACC, so it
seems a bit weird to enable it, but it's not going to do any harm, of
course.

GC> The other three:
GC>   array-compare
GC>   infinite-recursion
GC>   use-after-free
GC> do seem to be enabled by '-Wall',

 Yes, this is indeed the case according to gcc sources too.

GC> The use-after-free one is weird

 It's indeed weird because according to gcc change log it was added on
2022-01-15 but then removed on 2022-03-30. However what really happened is
that the option has been added in 671a283636d (Add -Wuse-after-free
[PR80532]., 2022-01-15) with incorrect comment syntax in the file
containing the options (gcc/c-family/c.opt) and this was fixed later, so
the change log is just wrong.

GC>   https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html#Option-Summary
GC> speaks only of
GC>   -Wno-analyzer-use-after-free
GC> whereas the "warnings" page
GC>   https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
GC> says that
GC>   -Wuse-after-free=2
GC> is enabled by '-Wall'.

 This option is actually documented together with the other C++-specific
options at

https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options
 

GC> At first, I thought that the "analyzer-" part might have been a
GC> typographical error

 No, these are the options for the gcc static analyzer that is still being
worked on. It promises to be useful, but so far it's still unsuitable for
use with C++ (or at least it was when I looked at it the last time a couple
of months ago).

 Regards,
VZ

Attachment: pgpdeNcIZbLef.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]