From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6277 invoked by alias); 2 Feb 2016 22:27:52 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 6248 invoked by uid 89); 2 Feb 2016 22:27:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:50-192-, H*RU:sk:50-192-, Hx-spam-relays-external:sk:50-192-, kitchen X-HELO: limerock03.mail.cornell.edu Received: from limerock03.mail.cornell.edu (HELO limerock03.mail.cornell.edu) (128.84.13.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Feb 2016 22:27:50 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock03.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id u12MRm62009517 for ; Tue, 2 Feb 2016 17:27:48 -0500 Received: from [10.13.22.4] (50-192-26-105-static.hfc.comcastbusiness.net [50.192.26.105]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id u12MRkPD002535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Tue, 2 Feb 2016 17:27:48 -0500 To: cygwin From: Ken Brown Subject: Defining _GNU_SOURCE hides the declaration of aligned_alloc Message-ID: <56B12D61.7030200@cornell.edu> Date: Tue, 02 Feb 2016 22:27:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00027.txt.bz2 The issue in the Subject line came up in connection with an emacs bug report. Here's a test case: $ cat test.c #define _GNU_SOURCE #include int main () { aligned_alloc (1, 1); } $ gcc test.c -Wimplicit-function-declaration test.c: In function ‘main’: test.c:7:3: warning: implicit declaration of function ‘aligned_alloc’ The cause is that the declaration of aligned_alloc in stdlib.h is guarded by #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L; but defining _GNU_SOURCE causes __ISO_C_VISIBLE to be defined as 1999. Here's an excerpt from /usr/include/sys/cdefs.h showing how this happens: /* Deal with _GNU_SOURCE, which implies everything and the kitchen sink */ #ifdef _GNU_SOURCE [...] #define _XOPEN_SOURCE 700 [...] #endif [...] #if _XOPEN_SOURCE - 0 >= 700 [...] #define _POSIX_C_SOURCE 200809 [...] #endif [...] #if _POSIX_C_SOURCE >= 200809 [...] #define __ISO_C_VISIBLE 1999 [...] #endif /* _POSIX_C_SOURCE */ According to the discussion of the emacs bug I mentioned, Linux and FreeBSD don't have this issue. Should Cygwin's headers be changed to conform to those other platforms? Ken -- 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