EasyManua.ls Logo

Intel i960 - Page 232

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Language Implementation
7-43
7
Similarly, the address of the compound expression can be taken. These
two expressions are equivalent:
&(a, b)
a, &b
A conditional expression is a valid lvalue if its type is not void and the true
and false branches are both valid lvalues. For example, these two
expressions are equivalent:
(a ? b : c) = 5
(a ? b = 5 : (c = 5))
A cast is a valid lvalue if its operand is valid. Taking the address of the
cast is the same as taking the address without a cast, except for the type of
the result. For example, these two expressions are equivalent (but the
second may be valid when the type of
a does not permit a cast to int *):
&(int *)a
(int **)&a
A simple assignment whose left-hand side is a cast works by converting
the right-hand side first to the specified type, then to the type of the inner
left-hand side expression. After this is stored, the value is converted back
to the specified type to become the value of the assignment. Thus, if
a has
type
char *, the following two expressions are equivalent:
(int)a = 5
(int)(a = (char *)5)
An assignment-with-arithmetic operation such as += applied to a cast
performs the arithmetic using the type resulting from the cast, and then
continues as in the previous case. Therefore, these two expressions are
equivalent:
(int)a += 5
(int)(a = (char *) ((int)a + 5))

Table of Contents

Related product manuals