[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] g++-12 valarray defect
From: |
Greg Chicares |
Subject: |
Re: [lmi] g++-12 valarray defect |
Date: |
Wed, 17 Aug 2022 12:19:50 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 |
On 8/17/22 00:40, Vadim Zeitlin wrote:
> On Wed, 17 Aug 2022 00:09:06 +0000 Greg Chicares <gchicares@sbcglobal.net>
> wrote:
>
> GC> Minimal reproducible test case:
[...]
> I can confirm that I can reproduce the problem here too, just by adding
> -Walloc-zero and -O1 (or greater) flags to the compiler command line.
>
> Have you considered reporting this to gcc? I can't find any existing bug
> reports about this in their bug tracker.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106664
I presented a different case first:
std::valarray<double> w {1};
w.resize(0); // warns
because I found a couple of invalid reports of errors assigning
valarrays of incompatible sizes, and I wanted to guide them away
from thinking this was just another instance of that mistake.
I incorporated the insights you offered.
> GC> It also seems weird that the warning is given on a system header,
> GC> where I thought it would be disregarded. Maybe that's because
> GC> it's inlined.
>
> Yes, I guess this is the explanation. But it doesn't really help dealing
> with this warning, unfortunately.
I can deal with it pragmatically.