Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site eneevax.UUCP Path: utzoo!linus!decvax!harpo!seismo!rlgvax!cvl!umcp-cs!eneevax!chris From: chris@eneevax.UUCP Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Another fun C bug (4.1 PCC) Message-ID: <35@eneevax.UUCP> Date: Sun, 4-Dec-83 17:48:44 EST Article-I.D.: eneevax.35 Posted: Sun Dec 4 17:48:44 1983 Date-Received: Tue, 6-Dec-83 23:46:02 EST Organization: Univ. of Maryland, EE Dept. Lines: 22 While hacking today I accidently broke a C function. Did the compiler complain? Yes, but not in the expected way! Here's a (very) condensed demo of the bug. bug.c: int bug[10]; bug1 (t) int bug; { int s = bug; } As you can see, bug1 incorrectly declares "bug" as an argument, while the arglist inside parens lists 't'. Instead of griping, the compiler quietly accepts it! However, as soon as one tries to access 'bug', it generates a "warning: bad arg temp". Indeed, the code generated has something bizarre in it. Any pcc wizards know how to fix this? -- Chris Torek, UMCP CS Dept UUCP: umcp-cs!chris ARPA: chris@maryland CSNET: chris@umcp-cs