[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/4] configure: Enforce gnu99 C language standard
From: |
Javier Martinez Canillas |
Subject: |
Re: [PATCH v2 2/4] configure: Enforce gnu99 C language standard |
Date: |
Tue, 7 Apr 2020 13:37:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 4/7/20 12:41 PM, Daniel Kiper wrote:
> On Tue, Apr 07, 2020 at 11:38:16AM +0200, Javier Martinez Canillas wrote:
>> On 4/3/20 2:45 PM, Daniel Kiper wrote:
>>> Commit d5a32255d (misc: Make grub_strtol() "end" pointers have safer
>>> const qualifiers) introduced "restrict" keyword into some functions
>>> definitions. This keyword was introduced in C99 standard. However, some
>>> compilers by default may use C89 or something different. This behavior
>>> leads to the breakage during builds when c89 or gnu89 is in force. So,
>>> let's enforce gnu99 C language standard for all compilers. This way
I got confused by the intention of this patch since you said enforce
here. Probably it should something like set gnu99 by default and allow
users to override.
[snip]
>>>
>>
>> I would add a comment here explaining why gnu99 is enforced.
>
> I am not convinced that we should repeat here what is said in the commit
> message...
>
I disagree. If you are reading this file is much easier to read the comment
than having to do a git blame and git show to figure out the rationale of it.
>>> +BUILD_CFLAGS="-std=gnu99 $BUILD_CFLAGS"
>>> +HOST_CFLAGS="-std=gnu99 $HOST_CFLAGS"
>>> +TARGET_CFLAGS="-std=gnu99 $TARGET_CFLAGS"
>>> +
>>
>> Do you want to allow distros to override the -std option or do you want to
>> always force to use gnu99? If the latter then I think instead it should be:
>>
>> BUILD_CFLAGS="$BUILD_CFLAGS -std=gnu99"
>> HOST_CFLAGS="$HOST_CFLAGS -std=gnu99"
>> TARGET_CFLAGS="$TARGET_CFLAGS -std=gnu99"
>
> I want to allow everybody to override the defaults. In general I think
> that we should not impose any artificial limits. If user wants to shoot in
> his/her foot he/she should be allowed to do that... In most cases...
>
Yes, that makes sense to me. Specially since as Leif said one could want to use
a higher version. I just asked since it wasn't clear to me.
The change looks good, so if you re-post feel free to add
Reviewed-by: Javier Martinez Canillas <address@hidden>
Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat
- Re: [PATCH v2 3/4] INSTALL/configure: Update install doc and configure comment, (continued)
[PATCH v2 2/4] configure: Enforce gnu99 C language standard, Daniel Kiper, 2020/04/03
Re: [PATCH v2 2/4] configure: Enforce gnu99 C language standard, Leif Lindholm, 2020/04/07
[PATCH v2 4/4] autogen: Replace -iname with -ipath in find command, Daniel Kiper, 2020/04/03