This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
improper guards on tzname/tzset
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 11 Feb 2016 19:35:35 -0600
- Subject: improper guards on tzname/tzset
- Authentication-results: sourceware.org; auth=none
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