Explanation D_GNU_SOURCE Why use it and when?

I know this is a macro that we pass to the function. How do you explain what the use of this macro is, and in what scenario should I use it? "

+5
source share
4 answers

While applications developed in accordance with POSIX.1 - (IEEE 1003.1-2008, ISO / IEC 9945: 2009) and / or Single Unix Specification 2008 (ISO / IEC 9945: 2009 with X / Open Curses) will help ensure portability your application. _GNU_SOURCEmost likely will limit the use of source code for GNU / Linux and GNU / Hurd systems if additional work is not done to eliminate the intolerance of such functions on other platforms.

/ .

/ , Unix- Unix- ( Microsoft Windows NT, 2000 , POSIX), POSIX.1 . / BSD NetBSD, FreeBSD, OpenBSD, DragonflyBSD, Unix- (Solaris, AIX, HP/UX ..), _GNU_SOURCE.

, , , , , GNU.

, GNU/Linux GNU/Hurd, , , Unix-Unix- .

, Unix Linux, _GNU_SOURCE , POSIX IEEE 1003.1/Single Unix Spec C99 (Standard C Library) .

+3

_GNU_SOURCE GNU C OS, GNU C, asprintf. , .

+5

glibc :

: _GNU_SOURCE

, : ISO C89, ISO C99, POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS GNU. , POSIX.1 BSD, POSIX .

http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html

+4

, , , , . _GNU_SOURCE - , .

+1

All Articles