PATH_MAX is optional in POSIX, and at least GNU/Hurd does not define it. Luckly there is no need to use it, as it is possible to use the modern behaviour of realpath() since POSIX.1-2007 [1] that allows NULL as output buffer, returning a newly allocated buffer with the resolved path. Some libc's (e.g. glibc) have been supporting this behaviour even before it was formally accepted in POSIX.
Attached there is a simple patch to use the modern realpath(), removing both PATH_MAX and the GCC warning suppressions.
[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html
This issue was resolved in the latest 3.2 beta release. Thanks for your patch.
Hi André,
Release 3.6.4 still seems to contain occurrences of MAX_PATH in the getCurrentDirectory() and getFullPathName() functions. Was this somehow reverted in the meantime?
Hi,
need to check if it was an accident or if there was a problem.
The patch only applied to the Linux variant of getCurrentDirectory, the Windows version still has MAX_PATH. But I intend to replace those by new C++ standard functions anyway.