Ticket #654 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

Out of order side effects of non-trivial arguments in function calls

Reported by: robertwb Owned by: scoder, robertwb
Priority: major Milestone: wishlist
Component: Code Generation Keywords:
Cc:

Description

cdef int f():
    print "f"

def g():
    print "g"

cdef foo(int x, object o):
    pass

foo(f(), g())

There may be others sitting out there due to inline expressions vs. temporary variables.

Change History

Changed 2 years ago by scoder

  • owner changed from somebody to scoder
  • status changed from new to assigned
  • milestone changed from wishlist to 0.14.1

Changed 2 years ago by scoder

  • status changed from assigned to closed
  • resolution set to fixed

Changed 2 years ago by robertwb

  • status changed from closed to reopened
  • resolution fixed deleted

This still has some issues.

Changed 2 years ago by robertwb

  • owner changed from scoder to scoder, robertwb
  • status changed from reopened to new

Changed 2 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed

Changed 2 years ago by scoder

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 0.14.1 to wishlist

Changed 2 years ago by robertwb

I was wondering how C enforced this without performance loss, and came across  http://stackoverflow.com/questions/2934904/order-of-evaluation-in-c-function-parameters

Changed 2 years ago by scoder

Interesting. So, would you suggest we follow the same scheme in Cython? I wouldn't object.

Changed 2 years ago by scoder

  • status changed from reopened to closed
  • resolution set to wontfix
  • summary changed from Out of order side effects on function calls to Out of order side effects of non-trivial arguments in function calls

It was decided that C functions should obey C calling semantics. The order of the evaluation of their arguments is therefore undefined.

Note: See TracTickets for help on using tickets.