This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

_DEFAULT_SOURCE expected semantic

Recently on libc-help [1] [2] it was raised some questions about 
_DEFAULT_SOURCE semantic in regard which standard it defines.

After some discussion the issues seems to be which would be the expected 
define, if new standards values would change its definition, and
if user would require to add configuration checks to check which
POSIX1 and XSI extension it provides.

The _DEFAULT_SOURCE was added on glibc 2.19 (commit c688b4196014e016) and
explicit stated that it implies -D_BSD_SOURCE -D_SVID_SOURCE 
-D_POSIX_C_SOURCE=200809L.  Also, glibc 2.20 changed change _BSD_SOURCE and 
_SVID_SOURCE to define _DEFAULT_SOURCE and later on 2.28 take in 
consideration _ISOC11_SOURCE as well.

So _DEFAULT_SOURCE always defines -D_POSIX_C_SOURCE=200809L without 
implicit _XOPEN_SOURCE from glibc 2.19 to 2.30.  Afaik there is no need to
currently to add POSIX1.2017 support, so the question is whether 
glibc will continue to eforce -D_POSIX_C_SOURCE=200809L for
_DEFAULT_SOURCE in future versions or if the flag will eventually be update 
whether/once a new POSIX1 version is required.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]