Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 12/4/83; site rlgvax.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!cornell!vax135!ariel!hou5f!hou5g!hou5h!eagle!harpo!seismo!rlgvax!guy From: guy@rlgvax.UUCP Newsgroups: net.bugs.2bsd,net.lang.c Subject: Re: Bug in cc Message-ID: <1454@rlgvax.UUCP> Date: Tue, 6-Dec-83 23:54:41 EST Article-I.D.: rlgvax.1454 Posted: Tue Dec 6 23:54:41 1983 Date-Received: Fri, 9-Dec-83 06:46:45 EST References: <738@garfield.UUCP> <2895@utcsrgv.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 36 struct foo { int x,y; char flag; struct something *sp; }; struct bar { int x,y; char flag; }; . . . 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. The language was changed as of System III so that the compiler doesn't (and shouldn't) complain if "x", "y", or "flag" either appears in a different place or has a different type (and since 4.xBSD comes with the System III VAX-11 PCC, it applies there also). This behavior is more sensible than the "sugared assembler" previous behavior - structure member names are not just symbolic names for byte offsets. There is no reason why structure names shouldn't be local to the structure - admittedly, putting in the unique tags that everybody did before this compiler change may make it a bit easier to identify what kind of a structure "c_foo" is a member of. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy