digitalmars.D.bugs - [Issue 6620] New: argument evaluation order inversed for extern(C)
- d-bugmail puremagic.com (32/32) Sep 07 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6620
- d-bugmail puremagic.com (15/16) Sep 07 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6620
http://d.puremagic.com/issues/show_bug.cgi?id=6620 Summary: argument evaluation order inversed for extern(C) Product: D Version: D2 Platform: Other OS/Version: FreeBSD Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dawg dawgfoto.de --- Comment #0 from dawg dawgfoto.de 2011-09-07 16:05:10 PDT --- version (none) { extern(C) int bar(int a, int b) { return b - a; } } else { int bar(int a, int b) { return b - a; } } void main() { int i; assert(bar(++i, ++i) == 1); } --- I know argument evaluation order isn't really guaranteed to be left to right. But having a reverse order for extern(C) calls is simply surprising. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 07 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6620 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |INVALID --- Comment #1 from yebblies <yebblies gmail.com> 2011-09-08 14:30:51 EST --- (In reply to comment #0)I know argument evaluation order isn't really guaranteed to be left to right.It isn't guaranteed _at all_, it's undefined. I think there's already an enhancement open about defining the order of evaluation, but until that's accepted this is perfectly valid behavior by the compiler. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 07 2011