clang copy of limits.h misses NAME_MAX

Hans-Bernhard Bröker HBBroeker@t-online.de
Thu Mar 17 23:49:00 GMT 2016


Am 17.03.2016 um 15:02 schrieb Hans-Bernhard Bröker:
> Am 17.03.2016 um 14:42 schrieb Ismail Donmez:

>> I am looking at clang 3.7 headers on Linux so this might be not 100%
>> same on Cygwin but, clang's limits.h has this on top:

Forgot to say this earlier: the cygwin version is the same in this respect.

> The actual system <limits.h> would have been
> #include_next'ed in turn (line 168 of /usr/lib/gcc/.../limits.h), but
> that was disabled by the above hack.

FWIW, I commented out that hack in my local copy, and it works again. 
See the relevant part of preprocessor output (manually indented for 
clarity):

  #  1 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 1 3 4
  # 39 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 3 4
   #  1 "/usr/lib/gcc/i686-pc-cygwin/5.3.0/include/limits.h" 1 3 4
   # 34 "/usr/lib/gcc/i686-pc-cygwin/5.3.0/include/limits.h" 3 4
    # 1 "/usr/lib/gcc/i686-pc-cygwin/5.3.0/include/syslimits.h" 1 3 4

     #  1 "/usr/include/limits.h" 1 3 4
     # 14 "/usr/include/limits.h" 3 4
      # 1 "/usr/include/features.h" 1 3 4
     # 15 "/usr/include/limits.h" 2 3 4
    #  8 "/usr/lib/gcc/i686-pc-cygwin/5.3.0/include/syslimits.h" 2 3 4
   # 35 "/usr/lib/gcc/i686-pc-cygwin/5.3.0/include/limits.h" 2 3 4
  # 40 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 2 3 4
# 17 "/usr/include/sys/dirent.h" 2 3 4

So that #define _GCC_LIMITS_H_ effectively broke a working GCC limits.h, 
causing all the things it defines to be missing.  That would be fine if 
clang's own version contained replacements for _all_ the system header's 
contents.  But it doesn't.

To me this looks like whatever the actual problem might have been, that 
hack in clang's limits.h was the wrong answer to it.

--
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



More information about the Cygwin mailing list