Hi, On Thu, Mar 17, 2016 at 3:11 PM, Hans-Bernhard Bröker <hbbroe...@t-online.de> wrote: > Hello there, > > clang has its own copy of some system headers. One of those lacks an entry > that breaks compilation of any program trying to work with directories the > POSIX way: > > $ cat tdirent.c > #include <dirent.h> > > void foo(void) > { > return; > } > > $ clang -c tdirent.c > In file included from tdirent.c:1: > In file included from /usr/include/dirent.h:6: > /usr/include/sys/dirent.h:31:15: error: use of undeclared identifier > 'NAME_MAX' > char d_name[NAME_MAX + 1]; > ^ > 1 error generated. > > The same file compiles just fine with GCC. The problem turns out to be that > NAME_MAX is defined in <limits.h> as seen by GCC, but not in the same header > read by clang. The culprit is this file: > > $ cygcheck -f /usr/lib/clang/3.7.1/include/limits.h > libclang3.7-3.7.1-1
clangs limits.h has: #if __STDC_HOSTED__ && __has_include_next(<limits.h>) #include_next <limits.h> #endif So it does depend on system's own limits.h which should have this definition. And cygwin's /usr/include/limits.h does have NAME_MAX defined but show its being hidden. Checking the preprocessed source file might help to see why. ismail -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple