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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; q=dns; s=default; b=vEoFuEdzmwOWHU3lnwhBg+4gNMRlxxuD6FpRa5FGD1E F/gaMhncJzODXPEE9WDJ/FiW1QhJVsNVHfisx9ilqr7WpXyv2UdtXnyOk9gQKKoV FTKqdMPim6lQkX4lzFEs0E5cavKPkqQXuataIwiy5aIeJSC09njbxa85+24ldCNo = 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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=default; bh=Vnpc4hTVhpIF3dg6fdMc2lF+U7w=; b=KsYiaM8BVymnPSm9c n5AsIEdTSFR/blCOTuEiP3dB3OC4nmFRfl6F/JN+37/hjtqYsTypElgwy+THlwDB bFctCV38lYJGRbGHgpKcD4SW9iWrpYC83Rw7YGqYY8dw5S/NlWggegz9BPSwY3gq Kq8fbwMNZo5SVsN9AQVOSjn4Z4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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.8 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=cygcheck, tdirentc, UD:tdirent.c, NAME_MAX X-HELO: mail-wm0-f44.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=lUJC5+9XMbPcXbsuLa6W6QeyPGlB6ml96tojvdOkHDs=; b=iguSG9S9+7O1vt7ZcSdLquBFHTMaqQ/a4d/kHc1ahTBr5gnYYwR4vlW8h+AqIbpQy3 scoTUO7sD9IwdQJ868exHstuVJZ5ONRDgxld35VNVmOv2UD/Qx8YV9I0dgHoY5u63OP5 ZT70XcJYCRlcV6cWwRaK3DVbyO3onDLtYglKWRk5z6kcmsconEUMVK7aPi1rapzZi9wr YyAcZOf7qNLz8bGbhX+AP50C40mt00mcAM3gt0e3rzODjlT2L7uwfvj4p2TJaekbQd89 iPxSAWulDPtwPBWyxYsYh5iEBtE7WpKW17QJtmP6HMeVC/Lu9ztcFQ7Jf5DIVmRRD58P O/9w== X-Gm-Message-State: AD7BkJKOxmwO0wAl2wFoTPewjQIsBkadh2wNGTYKpiXARerWoE0JP+9g5nNJq21gn6itCsGb8v0+rqZ428fxnA== X-Received: by 10.194.83.101 with SMTP id p5mr9986429wjy.141.1458220822634; Thu, 17 Mar 2016 06:20:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <56EAAD1B.4030107@t-online.de> References: <56EAAD1B DOT 4030107 AT t-online DOT de> From: Ismail Donmez Date: Thu, 17 Mar 2016 15:19:53 +0200 Message-ID: Subject: Re: clang copy of limits.h misses NAME_MAX To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u2HDKjVX031187 Hi, On Thu, Mar 17, 2016 at 3:11 PM, Hans-Bernhard Bröker 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 > > 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 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() #include_next #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