Marcus Brinkmann <[EMAIL PROTECTED]> writes:

What's the definition of mach_msg_type_t? I have the Hurd sources, but
not Mach sources, around.

> On Sun, Mar 31, 2002 at 01:59:56AM +0100, Marcus Brinkmann wrote:
> > ok, here is some hard data.  It turns out that the comparison:
> >    *(int *) &msg.error.err_type == *(int *) &inttype

Can you rewrite this without using the ugly explicit casts? If you
want the first member foo (which is an integer) on both sides, you
could simply write

  msg.error.err_type.foo == inttype.foo

Both foo:s must be of type int, although the explicit casts won't give
you any warnings if they aren't. If they really are, I think it's a
compiler error if you don't get the same results (the casts are ok,
and the address-of operator should force the C compiler to allocate
the objects the way one would expect). But a const static declaration
and no use of the address-of operator would give the compiler more
freedom to not allocate storage for inttype in the usual way.

/Niels

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to