Message-ID: <37AA4BFB.10A451EC@lan.tjhsst.edu> Date: Thu, 05 Aug 1999 22:44:11 -0400 From: Moogla X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Subject: Re: interesting error References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Brian Ronk wrote: > I got an error in a switch statement: case bypasses local variable initialization. any ideas what it is and how to fix? > > Brian Ronk interesting error? This is a standard ANSI C (i think) violation. You never, ever, ever, declare a variable in one case and use it in another. Keep the declarations out of the switch statement, or make them active only from case X: to the break; If you think you've done that, just check, make sure you're not reusing possibly active variable names. And check to make sure all your case statements have their appropriate breaks (so there's no unintended fall through that gcc happened to get annoyed over). for safety, do this case X: { //code break; } So that there's no variable leakage possible If you post your code, I think we can find the problem, and better suggest remedy tho. moogla