bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATH_MAX constant expression


From: Eric Blake
Subject: Re: PATH_MAX constant expression
Date: Tue, 21 Jun 2011 06:53:51 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/21/2011 03:50 AM, James Youngman wrote:
> On Mon, Jun 20, 2011 at 11:34 PM, Bruno Haible <address@hidden> wrote:
>> I find it reasonable to use "#ifdef PATH_MAX" in front of every use of
>> PATH_MAX, like POSIX requires.
> 
> I agree.
> 
> I think it would be helpful if there were some automated way of
> reminding people to do that though.  Many people develop on systems
> which define PATH_MAX but would want their code to build and work
> correctly on systems that do not.
> 
> Is the current syntax-check system flexible enough to warn about uses
> of PATH_MAX outside an #idfef PATH_MAX conditional?

It's easy enough to do a syntax check for the regex '\[PATH_MAX' for use
of PATH_MAX as an array bound, but not as easy for checking that
PATH_MAX is not used without #ifdef PATH_MAX and/or inclusion of
pathmax.h.  Perhaps we could also enhance -DGNULIB_POSIXCHECK to
intentionally #undef PATH_MAX, to make sure that code still compiles
when it is undefined, but I'm not quite sure how best to do that without
an override for <limits.h>.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]