Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!oliveb!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Oddities in ANSI 3rd review Message-ID: <62866@sun.uucp> Date: 4 Aug 88 19:11:02 GMT References: <253@gannet.cl.cam.ac.uk> <5806@haddock.ISC.COM> Sender: news@sun.uucp Lines: 46 > Well, a conforming implementation could certainly add members in the reserved > namespace (leading underscore), and it could provide convenient access to > them via a macro "#define tm_usec __tm_extended_usec" which is only defined > if the user has enabled the extensions ("#include " or > whatever). Or, alternatively, if your implementation has some way of distinguishing "no-extensions" mode from "extensions" mode with some #ifdef at compile time, you could do: struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; #ifdef __EXTENSIONS__ char *tm_zone; long tm_gmtoff; #else char *__tm_filler_1; long __tm_filler_2; #endif }; Unfortunately, there's no way to have unnamed fillers that aren't bit-fields, so there's no way I can see of doing this without polluting your namespace with ugly, although probably harmless "__tm_filler_N" names. If you could do this, I'd prefer it; struct tm { ... #ifdef __EXTENSIONS__ char *tm_zone; long tm_gmtoff; #else char *; int; #endif }; anyone? :-)