Message-ID: <01BB6054.A8EF6040@hf2rules.res.jhu.edu.res.jhu.edu> From: "Michael A. Phelps" To: "djgpp AT delorie DOT com" , "'Robert Fremin'" Subject: RE: Does DJGPP conform to ANSI-C standards with the for () ? Date: Sat, 22 Jun 1996 16:05:37 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ---------- From: Robert Fremin[SMTP:robert DOT fremin AT mailbox DOT swipnet DOT se] Sent: Saturday, June 22, 1996 12:13 PM To: djgpp AT delorie DOT com Subject: Does DJGPP conform to ANSI-C standards with the for () ? I had great difficulties to compile this code (example): void main() { for (int i=0; i<100; i++); } All I got was errors, i not initialized it said. I tried to move it out to... void main() { int i; for (i=0; i<100; i++); } ....but all the same. It only worked when I (at last) put the i globally. int i; void main() { for (i=0; i<100; i++); } Interesting. I tried the following code with DJGPP V2 and it worked: int main() { int i; for (i = 0; i < 100; i++); return 0; } Also, when using C++, the following code worked, as expected: int main() { for (int i = 0; i < 100; i++); return 0; } What makes DJGPP unable to use local variables in for() and asm("") ? Someone? You can declare variables as static and use them in an asm() construct. --Michael Phelps morphine AT cs DOT jhu DOT edu