www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/24/22:26:19

Xref: news2.mv.net comp.os.msdos.djgpp:5345
From: robert DOT fremin AT mailbox DOT swipnet DOT se (Robert Fremin)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Does DJGPP conform to ANSI-C standards with the for () ?
Date: Mon, 24 Jun 1996 22:42:06 GMT
Organization: -
Lines: 40
Message-ID: <31cf179c.1603755@nntpserver.swip.net>
References: <01BB6054 DOT A8EF6040 AT hf2rules DOT res DOT jhu DOT edu DOT res DOT jhu DOT edu> <4qibc1$434 AT news DOT inc DOT net>
NNTP-Posting-Host: dialup96-2-3.swipnet.se
NNTP-Posting-User: 41e1c758e329b31c4d905147051ba029
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 23 Jun 1996 02:49:37 GMT, nelson AT cs DOT uwp DOT edu (Jeremy Nelson) wrote:

>>From: 	Robert Fremin[SMTP:robert DOT fremin AT mailbox DOT swipnet DOT se]
>>
>>I had great difficulties to compile this code (example):
>>
>>void main()
>>{
>>	for (int i=0; i<100; i++);
>>}
>>
>3) 'int i' is not valid in the declaration portion of a for loop.
>   this is valid c++ code, but not valid c.

My prior compiler was C++, so I must have missed that rule by mistake.
(Luckily I discovered that DJGPP supported // remarks, which also(?) is
C++ by definition)

Empty parentheses should be translated to 'void' by the compiler.

>>void main()
>>{
>>	int i;
>>	for (i=0; i<100; i++);
>>}
>>
>>....but all the same.
>
>Odd -- it compiled for me.  Could you elaborate *specifically* as to the
>error messages you got?
>
It compiled OK the next day, maybe it was some system error?
I hate it when it is some other factor but my code that make
the bugs. Sitting down debugging, when it probably only took
a reboot to solve it. I won't dig into it further.


--- Robert Fremin -----------------------------------
--- http://bip.concept.se/user/sprite/hemsida.htm ---
-----------------------------------------------------

- Raw text -


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