$ gcc --version
gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-27)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -Wall -o reversi reversi.c -DDEBUG=1 -save-temps
reversi.c: In function 'alphabeta':
reversi.c:376: warning: value computed is not used

Expected behaviour: Loop prints 0....7

What happens: loop prints all 0's

When I comment out the scanf call, 0....7 is printed as expected. I originally
didn't use a second variable, but put it in out of desperation. The code
compiles correctly with icc.

There are no header files, the program is one self-contained C file. (If you
are curious, it doesn't work.)


-- 
           Summary: A variable is reset for no apparent reason
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbarbero at cs dot washington dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36304

Reply via email to