delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/23/00:04:38

Message-ID: <383A1ADC.6EF973B2@snetch.cpg.com.au>
Date: Tue, 23 Nov 1999 15:41:00 +1100
From: Michael Abbott aka frEk <20014670 AT snetch DOT cpg DOT com DOT au>
Organization: Student of Computer Power Institute
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: "for" messages
References: <F0458523BAB82511 DOT F75DE6F80A0A31D6 DOT 8D4647641CEFD2ED AT lp DOT airnews DOT net> <3839D8B8 DOT F0E10FB AT efd DOT lth DOT se> <31D677D3D5976EA1 DOT 2282C56AE95402D6 DOT 16BA81A6C65620CB AT lp DOT airnews DOT net>
Reply-To: djgpp AT delorie DOT com

Heya

I haven't used the C++ part, but I use C a lot and usually GPP says "file.c:
line: blablabla" if it's an error, and "file.c: line: warning: blablabla" if it's
a warning, so those are definitely errors (I think ;).

Try taking the variable declaration out of the loop and placing it before...
Something like...

int i;
for (i = 0; i < whatever; i ++)

(I don't have the original source on me, so this'll have to do... ;)

And compile and see what happens...

I don't know why the variable declaration wouldn't work inside the loop, but I
have a funny feeling about it...

- Michael

Rodeo Red wrote:

> Peter Danielsson wrote:
>
> > They are only warnings and should compile anyway.
>
> The plot thickens.
> Here is the exact command I used to try to compile
>
> C:\djgpp\Source>gpp testfile.cpp -o testfile.exe
> testfile.cpp: In function `int main(...)':
> testfile.cpp:25: name lookup of `i' changed for new ANSI `for' scoping
> testfile.cpp:19:   using obsolete binding at `i'
>
> There's no testfile.exe. As far as I know, that means it didn't compile. What
> would make this happen ?
> is the problem with the code ? or are my djfpp files corrupted ?
>
> Red



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019