Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sequence point
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Concept in computer programming}} In [[C (programming language)|C]] and [[C++]], a '''sequence point''' defines any point in a [[computer program]]'s [[execution (computing)|execution]] at which it is guaranteed that all [[side effect (computer science)|side effect]]s of previous evaluations will have been performed, and no side effects from subsequent evaluations have yet been performed. They are a core concept for determining the validity of and, if valid, the possible results of expressions. Adding more sequence points is sometimes necessary to make an expression defined and to ensure a single valid order of evaluation. With [[C11 (C standard revision)|C11]] and [[C++11]], usage of the term sequence point has been replaced by sequencing. There are three possibilities:<ref>{{cite web |title=ISO/IEC 14882:2011 |url=http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372 |accessdate=2012-07-04}}</ref><ref>{{cite web |title=A finer-grained alternative to sequence points (revised) (WG21/N2239 J16/07-0099) |url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html |accessdate=2012-07-05}}</ref><ref>{{cite web |title=Order of evaluation |url=http://en.cppreference.com/w/c/language/eval_order |accessdate=2015-10-14}}</ref> #An expression's evaluation can be ''sequenced before'' that of another expression, or equivalently the other expression's evaluation is ''sequenced after'' that of the first. #The expressions' evaluation is ''indeterminately sequenced,'' meaning one is sequenced before the other, but which is unspecified. #The expressions' evaluation is ''unsequenced.'' The execution of unsequenced evaluations can overlap, leading to potentially catastrophic [[undefined behavior]] if they share [[State (computer science)|state]]. This situation can arise in [[parallel computation]]s, causing [[race condition]]s, but undefined behavior can also result in single-threaded situations. For example, <code>a[i] = i++;</code> (where {{code|a}} is an array and {{code|i}} is an integer) has undefined behavior.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)