Paul Eggert <[email protected]> writes:

> On 08/03/11 13:07, Simon Josefsson wrote:
>> It seems weird for test-getcwd.c to include pathmax.h and then do a
>> #ifndef PATH_MAX test?
>
> It is weird, and wrong.  And looking at the code, there are other
> glitches with respect to PATH_MAX.  Does the following quick patch
> work for you on the Hurd?  The basic idea is to add a new symbol
> GNULIB_defined_PATH_MAX for when gnulib defines PATH_MAX, and
> to remove some code that isn't needed now that pathmax.h is included.

Alas, I get the same error:

test-getcwd.c: In function 'test_long_name':
test-getcwd.c:119:11: error: missing binary operator before token "("

I believe it is because PATH_MAX is still expanded in the #elif, turning

#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
        - DIR_NAME_SIZE - BUF_SLOP) \
       <= PATH_MAX)

into

#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
        - DIR_NAME_SIZE - BUF_SLOP) \
       <= (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
                    : pathconf ("/", _PC_PATH_MAX)))

which still doesn't evaluate properly.

/Simon

Reply via email to