This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/5589: if (c > c++) is tested as yes by gcc !!!



>Number:         5589
>Category:       c
>Synopsis:       if (c > c++) is tested as yes by gcc !!!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 04 11:06:20 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     yann helleboid
>Release:        gcc version 2.7.2
>Organization:
>Environment:
Sun solaris 2.6 on a Sun E450
>Description:
the following program gives a wrong output

program :

#include <stdio.h>
int main()
{
  int c = 0;
  if (c > c++)
    printf ("there must be a bug in gcc\n");
  else
    printf ("no problem\n");
  return 0;
}

the compile line is:

gcc -o program program.c

running program gives :

there must be a bug in gcc



so gcc tells us that c is greater than c++ !!!!
>How-To-Repeat:
compile and run the program in the description zone
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]