lkml.org 
[lkml]   [2011]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] kconfig/kbuild: define _POSIX_C_SOURCE
On 10.4.2011 16:31, Valentin Ochs wrote:
> On Sat, Apr 09, 2011 at 11:34:00PM -0400, Arnaud Lacombe wrote:
>> On Sat, Apr 9, 2011 at 10:09 PM, Valentin Ochs <a@0au.de> wrote:
>>> The three patched files use PATH_MAX without defining the required
>>> _POSIX_C_SOURCE feature test macro. This prevents compilation with the
>>> musl libc. The patch applies to 2.6.38.2.
>>>
>>> Changes since v1:
>>> - fix scripts/kconfig/lex.zconf.c_shipped
>> this file is autogenerated from zconf.l, which should be updated as
>> well. I'm not sure how you searched for PATH_MAX, but you're still
>> missing `confdata.c' and `nconf.c'.

Yes, please fix the bison parser and run make GENERATE_PARSER=1
menuconfig to update the *_shipped files.


>> I had a quick look to different libc implementation, glibc and uClibc
>> default to _POSIX_C_SOURCE == 200112L, FreeBSD >8.0 defaults to
>> 200809L for >8.0, FreeBSD 7.x to 200112L.
>
> I got the value I used from the Open Group System Interfaces
> specification, but the musl author said that 200112L would be fine too.

I suggest you use 200112L, so that it is a nop for glibc/uClibc builds.
Please also accompany it with a /* for PATH_MAX */ comment or so.

>
>> None of these seems to requires _POSIX_C_SOURCE to define PATH_MAX, so
>> I'm not certain of the requirement of the change.
>
> While I don't want to appear like a language lawyer, the specification
> says that 'all symbols required by POSIX.1-2008 to appear when the
> header is included shall be made visible' when an application defines
> _POSIX_C_SOURCE. I guess the musl author interprets that as 'if you
> don't define the feature test macros, you're not getting PATH_MAX.' This
> does not seem to be incorrect behaviour to me.

While I don't completely understand the motivation for such
super-pedantic libc implementation, the fact is that POSIX says one
should define this macro, so let's define it, it does not hurt us.

Michal


\
 
 \ /
  Last update: 2011-04-19 11:57    [W:0.059 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site