On Thu, Dec 01, 2005 at 10:05:50AM -0800, Andrew Paprocki wrote:
> Is there a standard way that math operations should be performed using
> hrtime_t types if the compiler/platform defines longlong_t (from
> sys/types.h) to be a union?
>
> typedef union {
> double _d;
> int32_t _l[2];
> } longlong_t;
>
> Because of this, code which tries to do (time2 - time1) generates
> warnings under gcc when compiled with -ansi. Am I missing something
> here? Are applications supposed to detect if it is defined as a union
> and interact with the union members in that circumstance?
Looking at this, I believe it was mainly done so that Solaris system headers
and structures would still compile correctly under ANSI-C rules without a
bunch of extra, not so that the hrtime_t definition would actually be of
any use to anyone.
If you are compiling in ANSI-C mode, asking for ANSI-extension functionality
is a bit odd.
Cheers,
- jonathan
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> https://opensolaris.org:444/mailman/listinfo/opensolaris-code
--
Jonathan Adams, Solaris Kernel Development
_______________________________________________
opensolaris-code mailing list
[email protected]
https://opensolaris.org:444/mailman/listinfo/opensolaris-code