* [PATCH] manual: Update _DEFAULT_SOURCE.
@ 2018-02-19 12:45 Rical Jasan
2018-02-19 16:14 ` Joseph Myers
0 siblings, 1 reply; 5+ messages in thread
From: Rical Jasan @ 2018-02-19 12:45 UTC (permalink / raw
To: libc-alpha
Cc: Joseph Myers, Michael Kerrisk, Zack Weinberg, Carlos O'Donell
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.
* include/features.h: Add _ISOC11_SOURCE to test for whether
to define _DEFAULT_SOURCE.
* manual/creature.texi (_DEFAULT_SOURCE): Improve
documentation.
---
include/features.h | 2 +-
manual/creature.texi | 21 ++++++++++++++-------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/include/features.h b/include/features.h
index 137a90b405..d22c32eee6 100644
--- a/include/features.h
+++ b/include/features.h
@@ -214,7 +214,7 @@
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
diff --git a/manual/creature.texi b/manual/creature.texi
index fe7a7790a2..8876b2ab77 100644
--- a/manual/creature.texi
+++ b/manual/creature.texi
@@ -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
--
2.16.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] manual: Update _DEFAULT_SOURCE.
2018-02-19 12:45 [PATCH] manual: Update _DEFAULT_SOURCE Rical Jasan
@ 2018-02-19 16:14 ` Joseph Myers
2018-02-20 8:30 ` Rical Jasan
0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2018-02-19 16:14 UTC (permalink / raw
To: Rical Jasan
Cc: libc-alpha, Michael Kerrisk, Zack Weinberg, Carlos O'Donell
On Mon, 19 Feb 2018, Rical Jasan wrote:
> 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.
I think this is a header bug that was user-visible in releases, so should
be filed in Bugzilla before being fixed.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] manual: Update _DEFAULT_SOURCE.
2018-02-19 16:14 ` Joseph Myers
@ 2018-02-20 8:30 ` Rical Jasan
2018-02-20 13:59 ` Joseph Myers
0 siblings, 1 reply; 5+ messages in thread
From: Rical Jasan @ 2018-02-20 8:30 UTC (permalink / raw
To: Joseph Myers
Cc: libc-alpha, Michael Kerrisk, Zack Weinberg, Carlos O'Donell
On 02/19/2018 08:14 AM, Joseph Myers wrote:
> On Mon, 19 Feb 2018, Rical Jasan wrote:
>> 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.
>
> I think this is a header bug that was user-visible in releases, so should
> be filed in Bugzilla before being fixed.
I created BZ #22862. [0] Should I commit now, with an update to the
commit message/ChangeLog to include the BZ#?
Rical
[0] https://sourceware.org/bugzilla/show_bug.cgi?id=22862
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] manual: Update _DEFAULT_SOURCE.
2018-02-20 8:30 ` Rical Jasan
@ 2018-02-20 13:59 ` Joseph Myers
2018-02-21 10:49 ` Rical Jasan
0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2018-02-20 13:59 UTC (permalink / raw
To: Rical Jasan
Cc: libc-alpha, Michael Kerrisk, Zack Weinberg, Carlos O'Donell
On Tue, 20 Feb 2018, Rical Jasan wrote:
> On 02/19/2018 08:14 AM, Joseph Myers wrote:
> > On Mon, 19 Feb 2018, Rical Jasan wrote:
> >> 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.
> >
> > I think this is a header bug that was user-visible in releases, so should
> > be filed in Bugzilla before being fixed.
>
> I created BZ #22862. [0] Should I commit now, with an update to the
> commit message/ChangeLog to include the BZ#?
Yes, in this case.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] manual: Update _DEFAULT_SOURCE.
2018-02-20 13:59 ` Joseph Myers
@ 2018-02-21 10:49 ` Rical Jasan
0 siblings, 0 replies; 5+ messages in thread
From: Rical Jasan @ 2018-02-21 10:49 UTC (permalink / raw
To: Joseph Myers
Cc: libc-alpha, Michael Kerrisk, Zack Weinberg, Carlos O'Donell
On 02/20/2018 05:59 AM, Joseph Myers wrote:
> On Tue, 20 Feb 2018, Rical Jasan wrote:
>
>> On 02/19/2018 08:14 AM, Joseph Myers wrote:
>>> On Mon, 19 Feb 2018, Rical Jasan wrote:
>>>> 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.
>>>
>>> I think this is a header bug that was user-visible in releases, so should
>>> be filed in Bugzilla before being fixed.
>>
>> I created BZ #22862. [0] Should I commit now, with an update to the
>> commit message/ChangeLog to include the BZ#?
>
> Yes, in this case.
Committed: 862b45026fa6; RESOLVED BZ #22862. [0]
Thanks,
Rical
[0] https://sourceware.org/bugzilla/show_bug.cgi?id=22862
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-21 10:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19 12:45 [PATCH] manual: Update _DEFAULT_SOURCE Rical Jasan
2018-02-19 16:14 ` Joseph Myers
2018-02-20 8:30 ` Rical Jasan
2018-02-20 13:59 ` Joseph Myers
2018-02-21 10:49 ` Rical Jasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).