[FFmpeg-devel] [PATCH] Silence useless icc warnings

Måns Rullgård mans
Sun May 11 14:03:10 CEST 2008


Carl Eugen Hoyos <cehoyos at ag.or.at> writes:

> Hi!
>
> M?ns Rullg?rd <mans <at> mansr.com> writes:
>
>> > +# add some flags for Intel C Compiler
>> > +if `$cc --version |grep -q Intel`; then
>> 
>> I prefer the $(command) syntax, and the command could use a little
>> whitespace cosmetics.
>
> I saw that other similar checks just use if command; I hope that's
> better now.

What was I thinking?  Of course that's how it should be.

>> > +  # Just warnings, no remarks
>> > +  check_cflags -w1
>> > +  # -wd: Disable following warnings
>> > +  # 144, 167, 556: -Wno-pointer-sign
>> > +  # 10006: ignoring unknown option -fno-signed-zeros
>> > +  # 10156: ignoring option '-W'; no argument required
>> > +  check_cflags -wd144,167,556,10006,10156
>> > +  # 11030: ignoring option '-export'; no argument required
>> > +  check_ldflags -wd10156,11030
>> 
>> Wouldn't it be better to not pass those options in the first place?
>
> I prepared a patch not to pass the warning options (again inlined,
> sorry) and fix one of my comments, in case it's ok, there will be a
> moving of check_cflags -Wall first, then the patch, then another
> cosmetic commit.
>
> Please comment, Carl Eugen
>
> Index: configure
> ===================================================================
> --- configure   (revision 13113)
> +++ configure   (working copy)
> @@ -1784,8 +1784,19 @@
>  enabled debug && add_cflags -g"$debuglevel"
>
>  # add some useful compiler flags if supported
> +check_cflags -Wall
> +if $cc --version | grep -q Intel; then
> +  # Just warnings, no remarks
> +  check_cflags -w1
> +  # -wd: Disable following warnings
> +  # 144, 167, 556: -Wno-pointer-sign
> +  # 10006: ignoring unknown option -fno-signed-zeros
> +  check_cflags -wd144,167,556,10006
> +  # 10156: ignoring option '-export'; no argument required
> +  # 11030: Warning unknown option --as-needed
> +  check_ldflags -wd10156,11030
> +else
>  check_cflags -Wdeclaration-after-statement
> -check_cflags -Wall
>  check_cflags -Wno-switch
>  check_cflags -Wdisabled-optimization
>  check_cflags -Wpointer-arith
> @@ -1795,6 +1806,7 @@
>  check_cflags -Wwrite-strings
>  check_cflags -Wtype-limits
>  enabled extra_warnings && check_cflags -Winline
> +fi

On second thought, your first approach was probably better.  If the
compiler pretends to support flags it really doesn't, and then prints
warnings about it, there's not much we can do.  Adding the flags based
purely on the compiler name means we'll have to change the script if a
later version of the compiler adds support for these flags, and that's
not good either.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list