Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: ANSI typedef rules Keywords: typedef Message-ID: <10975@dog.ee.lbl.gov> Date: 15 Mar 91 07:24:32 GMT References: <793@llnl.LLNL.GOV> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 13 X-Local-Date: Thu, 14 Mar 91 23:24:32 PST In article <793@llnl.LLNL.GOV> rjshaw@ramius.llnl.gov (Robert Shaw) writes: >In regards to ANSI C, what (if anything) does the standard say about >an identifer that is in the scope of both a typedef and a variable >declaration by the same name? A typedef makes a synonym for an existing type up until it is overriden by a local (block scope) declaration for a variable; it is then hidden (and therefore entirely unusable) until that block scope is ended. Gcc 1.37.1 is doing exactly the right thing in your example. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab EE div (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov