This is the mail archive of the frysk-bugzilla@sourceware.org mailing list for the frysk 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]

[Bug general/5971] New: Associativity of C operators


Incorrect evaluation for C operators that associate right-to-left.

Frysk:
(fhpd) print i
1
(fhpd) print i++ + ++i + i 
7

But on a GCC compiler:
int i=1;
printf ("%d\n", i++ + ++i + i);

Output: 6


Gdb also seems to have this bug:
(gdb) print i
$2 = 1
(gdb)  print i++ + ++i + i
$3 = 7

-- 
           Summary: Associativity of C operators
           Product: frysk
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: frysk-bugzilla at sourceware dot org
        ReportedBy: tthomas at redhat dot com
OtherBugsDependingO 2246
             nThis:


http://sourceware.org/bugzilla/show_bug.cgi?id=5971

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


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