Article View: net.bugs.2bsd
Article #110Re: Bug in cc
From: Dave Sherman
Date: Mon, 05 Dec 1983 21:11
Date: Mon, 05 Dec 1983 21:11
33 lines
1310 bytes
1310 bytes
Is that a problem? I treat it as a compiler feature I take advantage of.
struct foo
{
int x,y;
char flag;
struct something *sp;
};
struct bar
{
int x,y;
char flag;
};
Both types can usefully refer to x,y, and flag, but only the
"foo" type has ->sp as well. I've never had a problem with this,
and hope new compilers aren't going to stop it.
Yes, I know you're all going to tell me I shouldn't do it,
and there are better ways of doing it, and it's dangerous,
and... But I happen to like it.
Note that the compiler will (and should) give you an error if
you try and put "x", "y" or "flag" into a different place in
the second structure than it appears in the first.
Dave Sherman
Toronto
--
{allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave
Technical Details
Message-ID:
<2895@utcsrgv.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utcsrgv!daveReferences:
<738@garfield.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: arc1-ca.pugleaf.net!utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.bugs.2bsd,net.lang.c Subject: Re: Bug in cc Message-ID: <2895@utcsrgv.UUCP> Date: Mon, 5-Dec-83 16:11:35 EST Article-I.D.: utcsrgv.2895 Posted: Mon Dec 5 16:11:35 1983 Date-Received: Mon, 5-Dec-83 16:27:49 EST References: <738@garfield.UUCP> Organization: The Law Society of Upper Canada, Toronto Lines: 33