in reply to Re^11: Setting signal handlers considered unsafe?
in thread Setting signal handlers considered unsafe?
Of course, you should never do that in C++. The standard specifically states that modifying a variable more than once in the same statement results in either undefined or implementation defined behavior (depending on what is actually being done). In you case, it's implementation defined, because there is no way to know the order of evaluation of the arguments. You also don't know when the post-increment happens, except that it will occur before the subroutine actually starts.
And technically, 0+x and ++x return r-values, not constants.
Sorry about that. I'm a recovering C++ programmer.<grin/>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: Setting signal handlers considered unsafe? (OT: C++)
by ikegami (Patriarch) on Nov 11, 2008 at 21:55 UTC |