Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!pasteur!ucbvax!husc6!ut-sally!utah-cs!sandra From: sandra@utah-cs.UUCP (Sandra J Loosemore) Newsgroups: comp.sys.atari.st Subject: Re: Alcyon C Bug N++ Message-ID: <5153X@utah-cs.UUCP> Date: 21 Jan 88 00:00:00 GMT References: <8712051307.AA12109@ucbvax.Berkeley.EDU> Organization: University of Utah CS Dept Lines: 20 In article <8712051307.AA12109@ucbvax.Berkeley.EDU>, aking@BFLY-VAX.BBN.COM (Allen King) writes: > Has anybody seen the following bug in version 4.14 of Alcyon C? > > main () > { register struct fl {float x, y;} *F; > register struct in {int x, y;} *I; > (etc.) I've run into this one before myself. If you read K&R carefully, two structures can have components with the same names *only* if the components are of the same type and at the same offset from the beginning of the structure. Many C compilers have departed from K&R and fixed this particular brain damage long ago -- I've been told that the ANSI C standard does not impose any similar restriction. It would be nice if Alcyon at least provided a warning about duplicate component names, but C has never been known as a language that provided good compiler diagnostics.... -Sandra Loosemore (sandra@cs.utah.edu)