On 02/11/13 12:15, Diego Biurrun wrote:
> On Sat, Nov 02, 2013 at 01:09:25AM +0200, Martin Storsjö wrote:
>> On Fri, 1 Nov 2013, Diego Biurrun wrote:
>>>
>>> configure: Properly check for availability of -Wno-foo warning flags
>>>
>>> For some weird reason gcc does not check if the -Wno disabling variants
>>> of warning flags match existing warning flags. Instead it swallows them
>>> silently. That is, unless other warning or error messages are generated,
>>> because then - for some even more bizarre reason - a complaint about the
>>> unknown disable warning flag is issued along with the error or warning
>>> message.
>>>
>>> Thus to check for the availability of a warning disabling option, one
>>> needs to check for the enabling variant instead and then add the
>>> disabling variant to CFLAGS.
>>>
>>> --- a/configure
>>> +++ b/configure
>>> @@ -3903,13 +3903,9 @@ enabled debug && add_cflags -g"$debuglevel" &&
>>> add_asflags -g"$debuglevel"
>>> # add some useful compiler flags if supported
>>> check_cflags -Wdeclaration-after-statement
>>> check_cflags -Wall
>>> -check_cflags -Wno-parentheses
>>> -check_cflags -Wno-switch
>>> -check_cflags -Wno-format-zero-length
>>> check_cflags -Wdisabled-optimization
>>> check_cflags -Wpointer-arith
>>> check_cflags -Wredundant-decls
>>> -check_cflags -Wno-pointer-sign
>>> check_cflags -Wcast-qual
>>> check_cflags -Wwrite-strings
>>> @@ -3918,6 +3914,17 @@ check_cflags -Wmissing-prototypes
>>> check_cflags -Wstrict-prototypes
>>> enabled extra_warnings && check_cflags -Winline
>>>
>>> +check_disable_warning(){
>>> + warning_flag=-W${1#-Wno-}
>>> + test_cflags $warning_flag && add_cflags $1
>>> +}
>>> +
>>> +check_disable_warning -Wno-parentheses
>>> +check_disable_warning -Wno-switch
>>> +check_disable_warning -Wno-format-zero-length
>>> +check_disable_warning -Wno-pointer-sign
>>> +enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
>>> +
>>> @@ -4008,7 +4015,6 @@ elif enabled gcc; then
>>> check_cflags -Werror=declaration-after-statement
>>> check_cflags -Werror=vla
>>> - enabled extra_warnings || check_cflags -Wno-maybe-uninitialized
>>> elif enabled llvm_gcc; then
>>> check_cflags -mllvm -stack-alignment=16
>>> elif enabled clang; then
>>
>> The maybe-uninitialized check still needs to be moved back into a
>> gcc specific block, since this now spews warnings with clang:
>> https://fate.libav.org/x86_64-linux-clang
>
> Wait, clang groks -Wmaybe-uninitialized, but not -Wno-maybe-uninitialized?
> WTF?
>
clang swallows everything and burps a lot, there is a -Wno- option to
make it do that quietly.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel