🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #324

Re: struct comparison

#324
From: Henry Spencer
Date: Fri, 14 Jul 1989 15:53
14 lines
938 bytes
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
Technical Details
Message-ID: <1989Jul14.155312.2063@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <2874@solo3.cs.vu.nl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!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