qemu-devel
[Top][All Lists]
Advanced

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

Compiler warnings with maximum warning level (was: Re: [PATCH for 7.2?]


From: Stefan Weil
Subject: Compiler warnings with maximum warning level (was: Re: [PATCH for 7.2?] target/i386: Remove compilation errors when -Werror=maybe-uninitialized)
Date: Wed, 7 Dec 2022 20:59:58 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

Am 07.12.22 um 20:11 schrieb Stefan Weil:
On 12/7/22 14:24, Eric Auger wrote:
Initialize r0-3 to avoid compilation errors when
-Werror=maybe-uninitialized is used

../target/i386/ops_sse.h: In function ‘helper_vpermdq_ymm’:
../target/i386/ops_sse.h:2495:13: error: ‘r3’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   2495 |     d->Q(3) = r3;
        |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2494:13: error: ‘r2’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   2494 |     d->Q(2) = r2;
        |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2493:13: error: ‘r1’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   2493 |     d->Q(1) = r1;
        |     ~~~~~~~~^~~~
../target/i386/ops_sse.h:2492:13: error: ‘r0’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   2492 |     d->Q(0) = r0;
        |     ~~~~~~~~^~~~

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Fixes: 790684776861 ("target/i386: reimplement 0x0f 0x3a, add AVX")

---

Am I the only one getting this? Or anything wrong in my setup.

Hi Eric,

no, you are not the only one. I regularly build with higher warning levels, for example with -Weverything on macOS, and get a much longer list which includes the mentioned warnings (see below).

The latest QEMU code produces 6780505 compiler warnings and a build log file with 2.7 GB (!) with compiler option `-Weverything` on macOS.

Many warnings occur more than once, but there remain 193313 unique warnings for the QEMU code (see https://qemu.weilnetz.de/test/warnings-20221207.txt). Here is a list of all kinds of warnings sorted by frequency:

   1 -Wkeyword-macro
   1 -Wundeclared-selector
   1 -Wunreachable-code-loop-increment
   1 -Wunused-but-set-parameter
   2 -Wgnu-union-cast
   2 -Woverlength-strings
   3 -Walloca
   5 -Wflexible-array-extensions
   5 -Wstrict-selector-match
   5 -Wstring-conversion
   5 -Wtautological-value-range-compare
   6 -Wcstring-format-directive
   8 -Wstatic-in-inline
  13 -Wobjc-messaging-id
  13 -Wvla
  14 -Wobjc-interface-ivars
  16 -Wimplicit-float-conversion
  17 -Wformat-nonliteral
  24 -Wredundant-parens
  39 -Wfloat-equal
  44 -Wc++-compat
  47 -Wzero-length-array
  53 -Wdouble-promotion
  53 -Wvariadic-macros
  65 -Wpacked
  74 -Wcomma
  82 -Wunreachable-code-return
  90 -Wformat-pedantic
  90 -Wmissing-noreturn
  94 -Wgnu-flexible-array-initializer
 120 -Wcovered-switch-default
 132 -Wdirect-ivar-access
 136 -Wconditional-uninitialized
 144 -Wgnu-designator
 147 -Wdisabled-macro-expansion
 150 -Wgnu-conditional-omitted-operand
 161 -Wunreachable-code-break
 184 -Wcompound-token-split-by-space
 228 -Wfloat-conversion
 248 -Wunreachable-code
 348 -Wgnu-binary-literal
 443 -Wshadow
 534 -Wmissing-variable-declarations
 563 -Wshift-sign-overflow
 613 -Wembedded-directive
 620 -Wgnu-zero-variadic-macro-arguments
 742 -Wswitch-enum
 843 -Wdocumentation
 897 -Wgnu-case-range
1292 -Wassign-enum
1621 -Wgnu-empty-struct
1700 -Wextra-semi
1779 -Wpointer-arith
1847 -Wbad-function-cast
2176 -Wdocumentation-unknown-command
2221 -Wmissing-field-initializers
3101 -Wsign-compare
3238 -Wunused-macros
3559 -Wcast-align
4528 -Wcast-qual
7066 -Wgnu-statement-expression
7651 -Wnull-pointer-subtraction
7995 -Wimplicit-int-conversion
8854 -Wpadded
9737 -Wshorten-64-to-32
10596 -Wgnu-empty-initializer
13274 -Wlanguage-extension-token
13899 -Wunused-parameter
15642 -Wused-but-marked-unused
18669 -Wpedantic
44737 -Wsign-conversion



reply via email to

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