[build2] build2 staging GCC 11 compiler warnings
Matthew Krupcale
mkrupcale at matthewkrupcale.com
Thu Jan 28 14:21:09 UTC 2021
On Wed, Jan 27, 2021 at 5:45 AM Boris Kolpackov <boris at codesynthesis.com> wrote:
>
> Found this bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753
This might be the same cause as pr54202[1,2]
> Skimming through it, it looks like this check is now enabled in more
> contexts (besides operator delete) which is causing more false positives.
Yeah, GCC 11 added[3] the ability for detecting free's done using
operator delete. There may be some other recent changes surrounding
this warning, but this is the one of which I'm aware.
> Do you think you could create a preprocessed TU for one of the cases
> that trigger this warning in build2 and attach it to the bug report
> as another example?
So I have a couple of simplified reproducers[4,5], both coming from
libbuild2/parser.cxx and requiring compiling at -O1 or higher. The
first one[4] is closer to the original parser.ii but removes some
extraneous things and has a simplified function f() which invokes the
warning. The second[5] is even further simplified and uses a
small_vector of small_vector<int, 1> reproducer f(). Ultimately, I
think these are both some form of [2].
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753#c7
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54202
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57111
[4] https://godbolt.org/z/eKEM87
[5] https://godbolt.org/z/WrxWhW
More information about the users
mailing list