Re: [kvm-unit-tests v2 PATCH 2/3] Replace -Wextra with a saner list of warning flags

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

 



On 30.06.2017 10:19, Andrew Jones wrote:
> On Thu, Jun 29, 2017 at 08:42:52PM +0200, Thomas Huth wrote:
>> Using -Wextra together with -Werror is troublesome - various versions
>> of GCC produce suspicious or even wrong warnings with -Wextra which
>> then become fatal errors with -Werror. For example, the current state
>> of the kvm-unit-tests does not compile anymore with GCC 4.8.1 for
>> s390x due to an inadequate -Wmissing-field-initializers warning.
>> That's annoying for users who just would like to compile the
>> kvm-unit-tests and cumbersome for the developers who have to work
>> around these problems in the source code. So let's replace -Wextra
>> by a saner lists of warning flags that are normally enabled by -Wextra.
>> Since they apparently can be used for building x86, too, the flags
>> are now also applied to the global CFLAGS instead of specifying them
>> for the single targets only.
>>
>> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
>> ---
>>  v2:
>>  - Now that we've got COMMON_CFLAGS, the remaining flags can be
>>    added to the global CFLAGS, too
>>  - Removed -Wsign-compare
> 
> I was just doing some reading about warning types. It looks like
> -Wsign-compare comes with -Wall anyway.

According to https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
it's only enabled by -Wall when you're compiling a C++ file, for plain C
it is only enabled by -Wextra.

 Thomas



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux