]> sourceware.org Git - glibc.git/commitdiff
manual: Update _DEFAULT_SOURCE. [BZ #22862]
authorRical Jasan <ricaljasan@pacific.net>
Mon, 19 Feb 2018 12:37:16 +0000 (04:37 -0800)
committerRical Jasan <ricaljasan@pacific.net>
Wed, 21 Feb 2018 10:38:42 +0000 (02:38 -0800)
The description of the interplay between feature test macros and
compiler options in the description of _DEFAULT_SOURCE is a little
confusing, and dated, so clarify the situation, and don't assume a
specific value for _DEFAULT_SOURCE.

Also, _DEFAULT_SOURCE is supposed to be defined if none of the C/POSIX
feature test macros are defined, but the condition was lacking a test
for _ISOC11_SOURCE, so that is also addressed.

[BZ #22862]
* include/features.h: Add _ISOC11_SOURCE to test for whether
to define _DEFAULT_SOURCE.
* manual/creature.texi (_DEFAULT_SOURCE): Improve
documentation.

ChangeLog
include/features.h
manual/creature.texi

index 25b8e1264d36f99fc6240caddc9a1216c150c859..d6adafa0062c2b979e474537954f0655c0b49634 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-21  Rical Jasan  <ricaljasan@pacific.net>
+
+       [BZ #22862]
+       * include/features.h: Add _ISOC11_SOURCE to test for whether to
+       define _DEFAULT_SOURCE.
+       * manual/creature.texi (_DEFAULT_SOURCE): Improve documentation.
+
 2018-02-21  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #20890]
index 137a90b4055ae45a137fc0e4d1514b17f3cef257..d22c32eee6a98c350cad4267b15355fb271b9818 100644 (file)
    define _DEFAULT_SOURCE.  */
 #if (defined _DEFAULT_SOURCE                                   \
      || (!defined __STRICT_ANSI__                              \
-        && !defined _ISOC99_SOURCE                             \
+        && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE  \
         && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE  \
         && !defined _XOPEN_SOURCE))
 # undef  _DEFAULT_SOURCE
index fe7a7790a2a9d97165b7b654559d03c240472c49..8876b2ab779c988fdfb8bb064b940b6a03f37e25 100644 (file)
@@ -221,13 +221,20 @@ precedence.
 If you define this macro, most features are included apart from
 X/Open, LFS and GNU extensions: the effect is to enable features from
 the 2008 edition of POSIX, as well as certain BSD and SVID features
-without a separate feature test macro to control them.  Defining this
-macro, on its own and without using compiler options such as
-@option{-ansi} or @option{-std=c99}, has the same effect as not
-defining any feature test macros; defining it together with other
-feature test macros, or when options such as @option{-ansi} are used,
-enables those features even when the other options would otherwise
-cause them to be disabled.
+without a separate feature test macro to control them.
+
+Be aware that compiler options also affect included features:
+
+@itemize
+@item
+If you use a strict conformance option, features beyond those from the
+compiler's language version will be disabled, though feature test
+macros may be used to enable them.
+
+@item
+Features enabled by compiler options are not overridden by feature
+test macros.
+@end itemize
 @end defvr
 
 @defvr Macro _ATFILE_SOURCE
This page took 0.084364 seconds and 5 git commands to generate.