Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1a 7/7/83; site rlgvax.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards,net.lang.c Subject: Two C compiler questions Message-ID: <973@rlgvax.UUCP> Date: Sun, 7-Aug-83 04:41:55 EDT Article-I.D.: rlgvax.973 Posted: Sun Aug 7 04:41:55 1983 Date-Received: Mon, 8-Aug-83 03:15:52 EDT Organization: CCI Office Systems Group, Reston, VA Lines: 29 1) What is the "poor, and in some cases, incorrect, code" that was generated by the System III (and 4.1BSD) VAX-11 C compiler before it was changed to ignore advice to put scalars shorter than 32 bits into a register? The main difference in the System III compiler (which I assume is the "before" picture) and the 4.1BSD compiler (which I assume is the "after" picture) in this regard is that the System III compiler has some code that looks sort of like it lengthens any such declaration to "int", while the 4.1BSD compiler just ignores the "register" part. 2) If you declare a structure in the fashion struct foo { int foo; int bar; } foo[1]; and then reference foo[0].foo as foo->foo; the System III/4.1BSD PCC complains about "struct/union or struct/union pointer required". Some people here use this coding style, and object that since an unsubscripted reference to an array should refer to the address of that array, this construct is perfectly legitimate. PCC, however, requires that the object be a pointer, and does not consider a reference to an array to be equivalent. Is this a bug or a feature of PCC? Guy Harris {seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy