From: sl AT psycode DOT com DOT REMOVE_THIS Newsgroups: comp.os.msdos.djgpp Subject: DJGPP/GCC bug found Date: 13 Sep 1998 16:45:21 GMT Organization: http://www.supernews.com, The World's Usenet: Discussions Start Here Lines: 66 Message-ID: NNTP-Posting-Host: 205.205.70.111 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, I'm unsure who is to blaim for the following bug, but here it is: --------------- #include //Stream library #include //Console i/o library #include int x; //Horizontal position of star int y; //Vertical position of star void Init() { x=40; y=12; } void Display() { gotoxy(x,y); //Move cursor (conio) cout << "*"; //Display a star (iostream) } void Up() { y-=1; //Up one line } void Down() { y+=1; //Down one line } void Left() { x-=1; //Left one position } void Right() { x+=1; //Right one position } //Main program void main() { setvbuf(stdout, NULL, _IONBF, 0); Init(); Display(); //Display it on the screen Up(); //Move it up Display(); //Display it again Up(); //Move it further up Display(); //Display it again return; } ---------------- In the above example, the compiler complains "return;" is used in a case where "main()" is non-void.. But as you can see, it IS declared to return void! Anyway, I am using DJGPP 2.1 with GCC 2.8.1.. Try and compile the code yourself. You will get the same results.. As for why I am using "void main", I am not; this code was provided to me by my teacher, so go blaim him .. I know better .. Gili