Proposal: API for thread-safe time zone functions

Garrett Wollman wollman at khavrinen.lcs.mit.edu
Thu Jun 7 19:34:07 UTC 2001


<<On Thu, 7 Jun 2001 15:28:52 -0400 (EDT), Jonathan Lennox <lennox at cs.columbia.edu> said:

> I'm not sure I follow you...you'd prefer the 'struct timezone' (or whatever)
> name, but you think it wouldn't get past a standards committee?

Precisely.  The reason is that the C language has opaque (incomplete)
structures, but for technical reasons it cannot have opaque typedefs,
and multiple typedefs for the same name in the same scope are not
permitted even if they resolve to the same type.  (Unless C99 fixed
that bug...?)

(Thus, if I am designing a library which exports a function that
references a timezone, I can't use the `timezone_t' type without
pulling in large amounts of namespace pollution, but I can easily do
so with either a plain string, or a `struct timezone *'.  Using a
`void *' would also work, at the cost of type safety.)

-GAWollman




More information about the tz mailing list