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.