lmi
[Top][All Lists]
Advanced

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

Re: [lmi] How to suppress this gcc-9 diagnostic?


From: Vadim Zeitlin
Subject: Re: [lmi] How to suppress this gcc-9 diagnostic?
Date: Thu, 30 Apr 2020 02:32:21 +0200

On Wed, 29 Apr 2020 12:44:59 +0000 Greg Chicares <address@hidden> wrote:

GC> A unit test (which has always worked) now fails to compile with
GC> MinGW-w64 gcc-9.3 due to -Werror and -Wnull-dereference. I don't
GC> see how this code can possibly dereference a null pointer. Vadim,
GC> do you know a way to rewrite it so that it doesn't trigger this
GC> warning?

 After spending quite some time on this, I still unfortunately couldn't
find anything acceptable. For some reason the compiler just doesn't detect
that the vectors are always non-empty when using push_back().

 So for now I've opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94867
with the simplest possible example allowing to reproduce this (note that
this bug is not specific to MinGW, but happens with native Linux gcc 9
too). I won't hold my breath for it being fixed any time soon however, as
there are several other bugs about -Wnull-dereference opened since quite
some time. The main reason I still created this one is that none of them
provide any way to reproduce it so simply and, also, the other bugs seem to
be there since quite some time and manifested themselves with gcc 8 too,
while this one seems to be a regression. So maybe it gets some attention
due to this, especially as there seem to be some discussions about making
-Wnull-dereference part of -Wall.

 But right now I can't really propose anything better than just disabling
the warning, sorry.
VZ

Attachment: pgpKl16dQz1fW.pgp
Description: PGP signature


reply via email to

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