RTEMS Target Issue #4 - timespec2bintime and strptime
Joel Sherrill
joel.sherrill@oarcorp.com
Mon Mar 21 16:29:00 GMT 2016
On 3/20/2016 9:05 PM, Yaakov Selkowitz wrote:
> 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.
>
I thought I had the example and real code compiling without issues
yesterday but today, it gives a warning.
Does my example compile OK with -Wall on a bare metal target?
Thanks.
--joel
More information about the Newlib
mailing list