[FFmpeg-devel] [PATCH] When checking for compiler flags, check if warnings are reported.

Diego 'Flameeyes' Pettenò flameeyes
Thu Oct 2 13:10:47 CEST 2008


M?ns Rullg?rd <mans at mansr.com> writes:

> Diego 'Flameeyes' Petten? wrote:
>>  check_cmd(){
>>      log "$@"
>> -    "$@" >> $logfile 2>&1
>> +    rm -f $TMPRES
>> +    ( "$@" 2>&1 && touch $TMPRES; ) | tee $TMPLOG >> $logfile
>> +    test -f $TMPRES
>
> I don't like the look of this.  I'm sure there's a better way, but I
> have to think about it.

Yes I sincerely don't find it the nicest approach, but again I have no
better way to handle this just yet; if you can find one I'd be very
pleased ;)

> Just set LC_ALL=C at the start of configure instead.  I've been meaning
> to do that anyway.

Probably a very good idea.

>
>>  check_cflags(){
>>      log check_cflags "$@"
>> -    check_cc "$@" <<EOF && add_cflags "$@"
>> +    check_cc "$@" <<EOF || return
>>  int x;
>>  EOF
>> +
>> +    grep -qi "warning" $TMPLOG && return
>> +    grep -qi "illegal option" $TMPLOG && return
>> +    grep -qi "unrecognized" $TMPLOG && return
>> +
>> +    add_cflags "$@"
>>  }
>
> This has two problems. Firstly, the return value from the function is
> wrong.

Good point, will fix it.

> Secondly, warnings are expected, or at least accepted, in a few
> of the tests (I don't recall which ones), so this is overly strict.

Hmm, on cflags tests you mean? I do expect warnings to be excepted and
accepted for most check_cc checks, but for flags checking?

I made sure the warnings are checked for _only_ during flags checking
because I did expect warnings in other case, but I wouldn't expect extra
warnings while checking for flags support, sincerely, can you give me
any example of a warning accepted during flags checking?

-- 
Diego "Flameeyes" Petten?
http://blog.flameeyes.eu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081002/795a3aac/attachment.pgp>



More information about the ffmpeg-devel mailing list