delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/03/17/09:12:36

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=Mpg
2syO4qS/py0RIjpNyE5BN/nZ2l0sBatqA2OWfM0oUwc8NPTuz/rtlwTrjYQuafDQ
xJSjLoOrfcezn0c5DK3YGDX4NOUiyYHWA54zIfkO/JGChnlyOdStFdWWTRI3IApu
46IFllsObEbmT1zmGaKbyg3prm5Khm84JM2LsNYE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; s=default; bh=lz4xb9UOy
l21e8SOjdLgAV+hJck=; b=pbTdVbb9QYVnHs4cGHOjSGPIuupgLy280jif2oIQk
cSVjbj3iqFbL3YpmrNeEEUDJOSsFNY5apLJ8kczDvs/u2MM/9xP7vaytwSrHiYcL
bykoUeeZP83JEj7LrOePJNvNsLYEsnHD1lTu5xh+PpMw2e3S0V9eonQ36BCNvF+R
io=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*r:sk:mailout, cygcheck, H*MI:online, H*M:online
X-HELO: mailout09.t-online.de
To: cygwin AT cygwin DOT com
From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= <HBBroeker AT t-online DOT de>
Subject: clang copy of limits.h misses NAME_MAX
Message-ID: <56EAAD1B.4030107@t-online.de>
Date: Thu, 17 Mar 2016 14:11:55 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.7.0
MIME-Version: 1.0

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


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019