improper guards on tzname/tzset
Joel Sherrill
joel.sherrill@oarcorp.com
Fri Feb 12 01:35:00 GMT 2016
Hi
I think there are improper standards guards around tzset()
and tzname. They appear to be turned off for -std=c99 and
setting _XOPEN_SOURCE has no impact.
glibc has them off for -stdc=c99 along and on when adding
-D_XOPEN_SOURCE=700.
Based on the change history on the following page, I think
they should be turned on anytime _POSIX_C_SOURCE is set.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html
strptime() appears to be similarly improperly guarded but
first appeared in Issue 4. I think that also means it is
available anytime _POSIX_C_SOURCE is set.
This would also impact the declarations of timezone, daylight,
and tzname. Which also seem to have the problem that tzname
is #define'd to refer to _tzname but daylight and _timezone
don't have this. See:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
I have no idea on __tzset_r() and __gettzinfo().
Can I get a double check on the guard analysis and then I will
propose a patch.
Thanks.
--joel
RTEMS
More information about the Newlib
mailing list