[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wrong order of preprocessor and compiler flags
From: |
Carlos O'Donell |
Subject: |
Re: Wrong order of preprocessor and compiler flags |
Date: |
Thu, 24 Mar 2022 12:08:07 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 |
On 3/24/22 11:41, Sam James wrote:
>
>
>> On 24 Mar 2022, at 14:42, Bob Friesenhahn
>> <bfriesen@simple.dallas.tx.us> wrote:
>>
>> On Thu, 24 Mar 2022, Evgeny Grin wrote:
>>>
>>> It's not uncommon to use CFLAGS for macros or for '-I' flags. I
>>> think it's easy to imagine other conflicting situation where the
>>> order of used flags is significant.
>>
>> It may not be uncommon, but it is a usage bug to use CFLAGS for
>> pre-processor options. Such usages should be corrected.
>>
>> Becides cases where the pre-processor may be used directly (not
>> sure if there are any), it should be considered that CPPFLAGS works
>> for both the C and C++ compilers but CFLAGS is only for the C
>> compiler.
>>
>>> Usage of CPPFLAGS before CFLAGS looks logical for me, I think
>>> autoconf should be fixed.
>>
>> It does feel more logical.
>>
>
> Agreed on both counts & with the original post. We handle stuff like
> this quite often downstream and would be glad to see this.
In glibc it's historical to list CFLAGS before CPPFLAGS, but I can't come up
with
example where the order matters.
I agree that making it consistent always helps.
--
Cheers,
Carlos.