Previous Table of Contents "New C Standard" commentary
940
An
941
Between the previous and next sequence point an object shall have its
stored value modified at most once by the evaluation of an expression.
942 Furthermore, the prior value shall be read only to determine the value to be stored.71)
943 The grouping of operators and operands is indicated by the syntax.72)
944
Except as specified later (for the function-call
945
Some operators (the unary operator
946 These operators yield values that depend on the internal representations of integers, and have implementation-defined and undefined aspects for signed types.
947 If an exceptional condition occurs during the evaluation of an expression (that is, if the result is not mathematically defined or not in the range of representable values for its type), the behavior is undefined.
948 The effective type of an object for an access to its stored value is the declared type of the object, if any.73)
949 If a value is stored into an object having no declared type through an lvalue having a type that is not a character type, then the type of the lvalue becomes the effective type of the object for that access and for subsequent accesses that do not modify the stored value.
950 71) This paragraph renders undefined statement expressions such as
i = ++i + 1;
a[i++] = i;
while allowing
i = i + 1;
a[i] = i;
951 72) The syntax specifies the precedence of operators in the evaluation of an expression, which is the same as the order of the major subclauses of this subclause, highest precedence first.
952
Thus, for example, the expressions allowed as the operands of the
binary
953
The exceptions are cast expressions (6.5.4) as operands of unary
operators (6.5.3), and an operand contained between any of the
following pairs of operators: grouping parentheses
954 Within each major subclause, the operators have the same precedence.
955 Left- or right-associativity is indicated in each subclause by the syntax for the expressions discussed therein.
956 73) Allocated objects have no declared type.
957
958
If a value is copied into an object having no declared type using
959 For all other accesses to an object having no declared type, the effective type of the object is simply the type of the lvalue used for the access.
960 An object shall have its stored value accessed only by an lvalue expression that has one of the following types:74)
961 a type compatible with the effective type of the object,
962 a qualified version of a type compatible with the effective type of the object,
963 a type that is the signed or unsigned type corresponding to the effective type of the object,
964 a type that is the signed or unsigned type corresponding to a qualified version of the effective type of the object,
965 an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union), or
966 a character type.
967 A floating expression may be contracted, that is, evaluated as though it were an atomic operation, thereby omitting rounding errors implied by the source code and the expression evaluation method.75)
968
The
969 Otherwise, whether and how expressions are contracted is implementation-defined.76)
970
Forward references:
the
971 74) The intent of this list is to specify those circumstances in which an object may or may not be aliased.
972 75) A contracted expression might also omit the raising of floating-point exceptions.
973 76) This license is specifically intended to allow implementations to exploit fast machine instructions that combine multiple C operators.
974 As contractions potentially undermine predictability, and can even decrease accuracy for containing expressions, their use needs to be well-defined and clearly documented.
Next
Created at: 2008-01-30 02:39:42
The text from WG14/N1256 is copyright © ISO