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

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=MENWgxZ9OdAP39ct
eFWeEfl1wKL9xFQ0KjN5b/QQn6zE64vWCYJOYi0G9Gj2MPuDRCSRxCe3LrdMcd3a
t7lNkr19JLCTJ+XsTatvDG7diSh2rvr2IAOtnHcA76ZBzT2U9yCuBspBh9snFvTc
VKDWa+aJDxFMALKcZpyMmSeM/cQ=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=uJWE2ryyZWMPKrTdTbdogf
uSu2o=; b=lxMW9G1LCjSeaGILrcWdMhz9KM7LJYZj+C0g20z8Q+1iJy14qhgl7p
cxxFca3vkKS4r/w1BvvKVyggscKh0j7R/b5X/W5nWILjEPiGRYlV6/JHstUIgslx
2NWePWSepG+YaWqu8bYpBnYwrrEGjRzEpT/Xi/5Xi7BW0QQhCyqGY=
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=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:CPzstQq, H*f:sk:CPzstQq, H*f:sk:nA AT mail, H*f:CAFo71_5
X-HELO: mail-wm0-f45.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WLRnEyOY7hpuo3N6l7ZhUG0YmKQ+S4a16P+McwjT110=; b=fIcKn9BSbWioFOhqXkfR358y0KQORYyJtDMpeFoopmua5KHOyzXVJcrh6yPLyj0GNV UTk+GqN3OVggyBcuwiP6JFwKsC0X61QyfWJWa21DS9zh/CXRILfvRkWa98nwyMi7/ZbS olGlvF4mdYgphmqtk+jY4C5z5zj8A0T0KIKDX1fCRcr88HMpAagGkd3vlaz1gj4O0HCL DtpHEfhGEtHG1jp+SEPz14rIIwOvkAqONRGLoCTwcHhu62dF/LVavt4M38udxBHaLyqF 2Su5SLiAMbLZPQYECRKI3JEXh7+9JGKwTJGwmrOOcfKk1CYS4qe7gQpOtX40Fyx3A8hR MEwQ==
X-Gm-Message-State: AD7BkJJtyOcGirAkKQhAzwHg0eiB2R9zS0knM9f7S8C1cth3KMTzZjr7At01IwQ9MGqikw==
X-Received: by 10.28.184.148 with SMTP id i142mr11179857wmf.22.1458221739410; Thu, 17 Mar 2016 06:35:39 -0700 (PDT)
Subject: Re: clang copy of limits.h misses NAME_MAX
To: cygwin AT cygwin DOT com
References: <56EAAD1B DOT 4030107 AT t-online DOT de> <CAFo71_5=CPzstQq8Vd3sDa6yGVDArp9oE2p1eeu-hqQbt95+nA AT mail DOT gmail DOT com>
From: Marco Atzeri <marco DOT atzeri AT gmail DOT com>
Message-ID: <56EAB2A8.4010400@gmail.com>
Date: Thu, 17 Mar 2016 14:35:36 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0
MIME-Version: 1.0
In-Reply-To: <CAFo71_5=CPzstQq8Vd3sDa6yGVDArp9oE2p1eeu-hqQbt95+nA@mail.gmail.com>
X-IsSubscribed: yes


On 17/03/2016 14:19, Ismail Donmez wrote:
> Hi,
>
> On Thu, Mar 17, 2016 at 3:11 PM, Hans-Bernhard Bröker
> <HBBroeker AT t-online DOT 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
>

it seems to prefer gcc headers

# 1 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 1 3 4
# 37 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 3 4
# 1 "/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/limits.h" 1 3 4
# 38 "/usr/bin/../lib/clang/3.7.1/include/limits.h" 2 3 4
# 17 "/usr/include/sys/dirent.h" 2 3 4



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