[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hurd builds
From: |
Simon Josefsson |
Subject: |
hurd builds |
Date: |
Wed, 03 Aug 2011 22:07:22 +0200 |
I'm trying to get gnulib to work on the Hurd, and ran into this in
test-getcwd.c:
test-getcwd.c: In function 'test_long_name':
test-getcwd.c:119:11: error: missing binary operator before token "("
The code is:
29 #include "pathmax.h"
...
108 static int
109 test_long_name (void)
110 {
111 #ifndef PATH_MAX
112 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
113 at least not on a local file system. And if we were to start
worrying
114 about remote file systems, we'd have to enable the wrapper function
115 all of the time, just to be safe. That's not worth the cost. */
116 return 0;
117 #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
118 - DIR_NAME_SIZE - BUF_SLOP) \
119 <= PATH_MAX)
120 /* FIXME: Assuming there's a system for which this is true,
121 this should be done in a compile test. */
122 return 0;
In pathmax.h, gnulib sets up a PATH_MAX like this:
# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
: pathconf ("/", _PC_PATH_MAX))
And of course the #elif fails because PATH_MAX isn't a constant
expression.
It seems weird for test-getcwd.c to include pathmax.h and then do a
#ifndef PATH_MAX test?
/Simon
- hurd builds,
Simon Josefsson <=