Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE35C1EB7@probe-2.acclaim-euro.net> From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: BUG Date: Mon, 1 Mar 1999 12:24:26 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com Carlos Giani_AEN2003 (M2003) writes: > Here's an example program: > > #include > #include > int main(void) > { > int x; > int y; > > x = 0; > > y = (x) ? 1 : 2; /* y will ALWAYS be 1 (this is the BUG!) */ > > printf("%i\n",y); > > getch(); > } > > I use RHIDE and GCC 2.8.1 This works correctly for me. Using gcc 2.8.1, I compile it with the options "gcc -O3 -Wall test.c -o test.exe", which gives the warning: test.c: In function `main': test.c:12: warning: control reaches end of non-void function You should fix that by returning something sensible (eg. zero) at the end of main(), but that is just a detail. Apart from this, your code works exactly as it should, and prints 2. What options do you use to compile it? Exactly what compiler packages did you install? Shawn Hargreaves.