Newsgroups: comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: struct comparison Message-ID: <1989Jul14.155312.2063@utzoo.uucp> Organization: U of Toronto Zoology References: <2874@solo3.cs.vu.nl> Date: Fri, 14 Jul 89 15:53:12 GMT In article <2874@solo3.cs.vu.nl> maart@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@zoo.toronto.edu