Article View: comp.std.c
Article #4419Re: On sequence points and evaluation order
From: Paul Eggert
Date: Sun, 03 Dec 1995 01:09
Date: Sun, 03 Dec 1995 01:09
12 lines
1038 bytes
1038 bytes
This point has been debated before. Some people think the standard
says `f()+f()' has undefined behavior when f has side effects
(e.g. if f is defined by `int f() { static int i; return i++; }').
Other people think the standard defines behavior for `f()+f()'.
Still other people think that that this example has undefined behavior,
but other, similar examples have defined behavior.
I don't know if the ISO C committee has issued an official ruling on this.
It is clearly an unnecessarily messy area in the C Standard.
As a practical matter, if the implementation does function inlining,
I wouldn't rely on the behavior being well-defined here.
Technical Details
Message-ID:
<49qtc0$72g@light.twinsun.com>Path:
arc1-ca.pugleaf.net!news.cs.ucla.edu!twinsun!not-for-mailReferences:
<49l428$od0@bolverk.cs.cornell.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.cs.ucla.edu!twinsun!not-for-mail From: eggert@twinsun.com (Paul Eggert) Newsgroups: comp.std.c Subject: Re: On sequence points and evaluation order Date: 2 Dec 1995 17:09:20 -0800 Organization: Twin Sun Inc, El Segundo, CA, USA Message-ID: <49qtc0$72g@light.twinsun.com> References: <49l428$od0@bolverk.cs.cornell.edu> NNTP-Posting-Host: light.twinsun.com