AW: [odb-users] gcc 13.2: vector.ixx: warning: ‘i’ may be used uninitialized
Siegmund, Harald
Harald.Siegmund at isotravel.com
Tue Sep 10 12:33:01 EDT 2024
Unfortunately the const doesn't make the warning go away.
I set up a small reproducer with Compiler Explorer for playing with this issue:
https://godbolt.org/z/7rhxTfqMf
It seems that several things have to come together to trigger the false warning. See the comments in the code. This strongly looks like a gcc bug. Clang stays silent.
-----Ursprüngliche Nachricht-----
Von: Boris Kolpackov <boris at codesynthesis.com>
Gesendet: Dienstag, 10. September 2024 10:26
An: Siegmund, Harald <Harald.Siegmund at isotravel.com>
Cc: odb-users at codesynthesis.com
Betreff: Re: [odb-users] gcc 13.2: vector.ixx: warning: ‘i’ may be used uninitialized
EXTERNAL EMAIL: Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
Siegmund, Harald <Harald.Siegmund at isotravel.com> writes:
> The compiler is quiet now with -O0 but still complains with -O3. This
> is clearly a gcc issue.
Hm, interesting. Maybe it thinks the non-inline call may change the local variable? Can you change the first line to read:
const bool t (_tracking ());
And see if that helps?
More information about the odb-users
mailing list