This is the mail archive of the
mailing list for the Cygwin project.
Re: Defining _GNU_SOURCE hides the declaration of aligned_alloc
- From: Yaakov Selkowitz <yselkowitz at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 2 Feb 2016 21:15:03 -0600
- Subject: Re: Defining _GNU_SOURCE hides the declaration of aligned_alloc
- Authentication-results: sourceware.org; auth=none
- References: <56B12D61 dot 7030200 at cornell dot edu>
On 2016-02-02 16:27, Ken Brown wrote:
The issue in the Subject line came up in connection with an emacs bug
Here's a test case:
$ 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:
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?
Yes, it should. I have added this to my queue of such fixes, which I
hope to post soon.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple