From: "Sly" Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP inconsistencies? Date: 13 Mar 1997 12:07:03 GMT Organization: Sly Lines: 44 Message-ID: <01bc2fa7$9893d3c0$8c081ecb@sly> References: <5g7p5i$abl AT netra DOT montana DOT edu> Reply-To: "Sly" NNTP-Posting-Host: max0ppp10.bne.aussie.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Paul Peavyhouse wrote in article <5g7p5i$abl AT netra DOT montana DOT edu>... > 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); > } Your first example is using C++ syntax to declare a variable at first point of use. This will not work under normal C, for it needs all variables declared BEFORE any code in the function. > char *str; > if ( (str = getenv("DEM_PATH")) == NULL) { > printf("\"DEM_PATH\" environment variable not set\n"); > exit(1); > } > That printf statement...is it a valid string in there? Shouldn't it be... printf("DEMPATH environment variable not set\n"); Or are you trying to put backslashes around it? Like this... printf("\\DEMPATH\\ environment variable not set\n"); Try these. They should work. -- TTFN Sly (Steve) sly AT aussie DOT net