bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [PATCH] autogen: fix definition of MAXPATHLEN


From: Pino Toscano
Subject: Re: [PATCH] autogen: fix definition of MAXPATHLEN
Date: Mon, 14 Oct 2013 20:03:58 +0200
User-agent: KMail/4.10.5 (Linux/3.10-2-amd64; KDE/4.10.5; x86_64; ; )

In data lunedì 14 ottobre 2013 10:22:36, Bruce Korb ha scritto:
> On 10/13/13 10:34, Pino Toscano wrote:
> > Hi,
> > 
> > attached there is a patch for autogen to fix the definition of
> > MAXPATHLEN when not defined already (either not directly or because
> > PATH_MAX is not defined either).
> > 
> > This caused a build failure in sharutils (which embeds the libopts
> > part of autogen) on GNU/Hurd (which provides no PATH_MAX nor
> > MAXPATHLEN) [1]. This happens because in autogen's autoopts.h there
> > is:
> > #  if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
> > which triggers a preprocessor parsing error when MAXPATHLEN is
> > defined as (size_t)4096.
> 
> I think the correct fix would be to ensure that "size_t" is defined.

You are misunderstanding the issue, which boild down to a bad way to 
define things used in preprocessor conditionals.

Let's pick a simplied version of how the above #if becomes:
 #if 10 > ((int)5)
No matter whether size_t is known or not by the preprocessor (and not 
even by the actual compiler), the cast in preprocessor condition is a 
syntax error, hence the issue.

This happens because, since MAXPATHLEN (and PATH_MAX) is not defined in 
Hurd's sys/param.h, in compat/compat.h the following line is used:
#  define MAXPATHLEN ((size_t)4096)
and thus a cast appears in the #if mentioned above (in autoopts.h).

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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