This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

improper guards on tzname/tzset


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]