public inbox for frysk-bugzilla@sourceware.org
help / color / mirror / Atom feed
* [Bug general/5971] New: Associativity of C operators
@ 2008-03-19 16:11 tthomas at redhat dot com
  2008-03-19 17:04 ` [Bug general/5971] " pmachata at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tthomas at redhat dot com @ 2008-03-19 16:11 UTC (permalink / raw)
  To: frysk-bugzilla

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-19 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-19 16:11 [Bug general/5971] New: Associativity of C operators tthomas at redhat dot com
2008-03-19 17:04 ` [Bug general/5971] " pmachata at redhat dot com
2008-03-19 17:30 ` tthomas at redhat dot com
2008-03-19 18:30 ` pmachata at redhat dot com
2008-03-19 19:18 ` tthomas at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).