[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/4] configure: factor out supported flag che
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/4] configure: factor out supported flag check |
Date: |
Mon, 23 Mar 2015 14:50:59 +0000 |
On Mon, Mar 23, 2015 at 2:44 PM, John Snow <address@hidden> wrote:
> On 03/23/2015 09:03 AM, Stefan Hajnoczi wrote:
>>
>> On Thu, Mar 19, 2015 at 03:01:35PM -0400, John Snow wrote:
>>>
>>> +cc_has_warning_flag() {
>>> + if [ "$2" != "--keep-tmpc" ]; then
>>> + write_c_skeleton;
>>> + fi
>>> +
>>> # Use the positive sense of the flag when testing for -Wno-wombat
>>> # support (gcc will happily accept the -Wno- form of unknown
>>> # warning options).
>>> - optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')"
>>> - if compile_prog "-Werror $optflag" "" ; then
>>> - QEMU_CFLAGS="$QEMU_CFLAGS $flag"
>>> + optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')"
>>> + compile_prog "-Werror $optflag" ""
>>> +}
>>> +
>>> +write_c_skeleton;
>>> +for flag in $gcc_flags; do
>>> + if cc_has_warning_flag $flag --keep-tmpc; then
>>
>>
>> The only caller that uses --keep-tmpc wants TMPC to be the skeleton
>> program anyway. The option can be dropped and the write_c_skeleton in
>> cc_has_warning_flag can be unconditional.
>>
>> Stefan
>>
>
> I just figured there was no use in rewriting the same skeleton file
> unconditionally in a loop.
>
> The helper is used later where we do want to regenerate the skeleton.
>
> If you still want me to just make it unconditional, I can, but I don't see
> the point.
Dropping it makes the code cleaner and simpler. The option is not
needed for functionality or correctness.
IMO it's premature optimization.
Stefan
[Qemu-devel] [PATCH v3 3/4] configure: silence glib unknown attribute __alloc_size__, John Snow, 2015/03/19
[Qemu-devel] [PATCH v3 1/4] configure: handle clang -nopie argument warning, John Snow, 2015/03/19