This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: RTEMS Target Issue #4 - timespec2bintime and strptime
- From: Yaakov Selkowitz <yselkowitz at cygwin dot com>
- To: newlib at sourceware dot org
- Date: Sun, 20 Mar 2016 21:05:53 -0500
- Subject: Re: RTEMS Target Issue #4 - timespec2bintime and strptime
- Authentication-results: sourceware.org; auth=none
- References: <56EF45D7 dot 9030306 at oarcorp dot com>
On 2016-03-20 19:52, Joel Sherrill wrote:
I have stripped a new warning in RTEMS down to needing to
define both _XOPEN_SOURCE and _BSD_SOURCE to be able
to use strptime() and timespec2bintime() in the same file.
Does the use of feature enable macros look OK in this
test case?
strptime is clearly _XOPEN_SOURCE, which is not part of the default set:
http://man7.org/linux/man-pages/man3/strptime.3.html
And timespec2bintime is a BSDism, per:
https://sourceware.org/ml/newlib/2015/msg00186.html
feature_test_macros(7) states: "If any of ... _XOPEN_SOURCE, ... is
explicitly defined, then _BSD_SOURCE, _SVID_SOURCE, and _DEFAULT_SOURCE
are not defined by default."
Therefore, both are required.
--
Yaakov