* Compiling QEMU with different optimization levels & -Werror=maybe-uninitialized
@ 2024-03-27 11:28 Marc-André Lureau
2024-03-27 11:41 ` Daniel P. Berrangé
0 siblings, 1 reply; 2+ messages in thread
From: Marc-André Lureau @ 2024-03-27 11:28 UTC (permalink / raw)
To: QEMU
Hi,
Depending -Doptimization=<value>, I get different results (GCC 13.2.1)
- g: produces -Werror=maybe-uninitialized errors
- 0: clean build
- 1: produces -Werror=maybe-uninitialized errors
- 2: clean build
- 3: produces few -Werror=maybe-uninitialized errors
- s: produces -Werror=maybe-uninitialized errors
They are about 20, probably false-positives, although it's
understandable the compiler is confused as I am too sometime!
Is it a known issue? Are we willing to help the compiler in all those
optimization levels? I can send a patch series for review in this
case.
thanks
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Compiling QEMU with different optimization levels & -Werror=maybe-uninitialized
2024-03-27 11:28 Compiling QEMU with different optimization levels & -Werror=maybe-uninitialized Marc-André Lureau
@ 2024-03-27 11:41 ` Daniel P. Berrangé
0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2024-03-27 11:41 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: QEMU
On Wed, Mar 27, 2024 at 03:28:08PM +0400, Marc-André Lureau wrote:
> Hi,
>
> Depending -Doptimization=<value>, I get different results (GCC 13.2.1)
> - g: produces -Werror=maybe-uninitialized errors
> - 0: clean build
> - 1: produces -Werror=maybe-uninitialized errors
> - 2: clean build
> - 3: produces few -Werror=maybe-uninitialized errors
> - s: produces -Werror=maybe-uninitialized errors
>
> They are about 20, probably false-positives, although it's
> understandable the compiler is confused as I am too sometime!
If any of those maybe-uninitialized warnings are genuine bugs, our
use of use of -ftrivial-auto-var-init provides a safety net that
protects us....
>
> Is it a known issue? Are we willing to help the compiler in all those
> optimization levels? I can send a patch series for review in this
> case.
...none the less, IMHO, it is good practice to initialize all local stack
allocated variables at time of declaration no matter what. So if you have
patches to clear those false positives, I'd suggest we just do it.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-27 11:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 11:28 Compiling QEMU with different optimization levels & -Werror=maybe-uninitialized Marc-André Lureau
2024-03-27 11:41 ` Daniel P. Berrangé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).