Mail Archives: djgpp/1997/03/13/08:00:48
Paul Peavyhouse <pv AT cs DOT montana DOT edu> 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
- Raw text -