struct comparison

Henry Spencer henry at utzoo.uucp
Sat Jul 15 01:53:12 AEST 1989


In article <2874 at solo3.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
>Why does the PROGRAMMER have to go through all that trouble?
>I just want to say:
>
>	puts(mork == mindy ? "equal" : "unequal");
>
>Is the ANSI committee trying to tell us the compiler cannot transform the
>equality test into the correct member-by-member comparison code?

Yes.  Think about unions.  Or pointers (do you compare the pointers or
what they point at?).  The compiler just doesn't have enough information.
-- 
$10 million equals 18 PM       |     Henry Spencer at U of Toronto Zoology
(Pentagon-Minutes). -Tom Neff  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list