Date: Thu, 13 Mar 1997 09:17:07 -0500 (EST) From: "art s. kagel IFMX x2697" To: Paul Peavyhouse Cc: djgpp AT delorie DOT com Subject: Re: DJGPP inconsistencies? In-Reply-To: <5g7p5i$abl@netra.montana.edu> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII The first construct, declaring the int variable i within the for loop, is only legal in C++ not in C. So take a careful look at each of your 'sometime's and you should see that it works in .cc files and in .c files which you have asked gcc to compile as C++ explicitely but not in normal C compiles. Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com On Wed, 12 Mar 1997, Paul Peavyhouse wrote: > I have noticed a few inconsistencies with the DJGPP compiler over > other C compilers I use. > The first one is that the lines: > > for(int i=0; i<256; i++) > { someFunction(i); > } > > won't compile SOMETIMES (?!?!?!), yet the lines: > > int i; > for (i=0; i<256; i++) > { someFunction(i); > } > > works everytime...why? > > Also, I sometimes get random compiler "parse" errors when I include > the following code in a program: > > char *str; > if ( (str = getenv("DEM_PATH")) == NULL) { > printf("\"DEM_PATH\" environment variable not set\n"); > exit(1); > } > > Yet again...WHY? > I really like the DJGPP compiler (just wish I could make it work under > MSDEV) and the ease of porting to/fro UNIX/DOS. Makes college life a helluva > lot easier...but these compiler problems bother me as far as how "compatible" > DJGPP really is. Anyone have any comments? > > PV > > > ______________________________________________________________________________ > > Paul Peavyhouse > http://www.cs.montana.edu/~pv > email: pv AT cs DOT montana DOT edu > ______________________________________________________________________________ >