(Cast to Union): Show definition of `union foo', `x' and `y'.
This commit is contained in:
parent
11723f5d07
commit
5d1b5d753d
16
c.texi
16
c.texi
|
@ -2529,7 +2529,7 @@ construct that stores a new value into a place where values can be
|
||||||
stored---for instance, in a variable. Such places are called
|
stored---for instance, in a variable. Such places are called
|
||||||
@dfn{lvalues} (@pxref{Lvalues}) because they are locations that hold a value.
|
@dfn{lvalues} (@pxref{Lvalues}) because they are locations that hold a value.
|
||||||
|
|
||||||
An assignment in C is an expression because it has a value; we call
|
In C, an assignment is an expression because it has a value; we call
|
||||||
it an @dfn{assignment expression}. A simple assignment looks like
|
it an @dfn{assignment expression}. A simple assignment looks like
|
||||||
|
|
||||||
@example
|
@example
|
||||||
|
@ -6795,8 +6795,14 @@ Using the cast as the right-hand side of an assignment to a variable of
|
||||||
union type is equivalent to storing in an alternative of the union:
|
union type is equivalent to storing in an alternative of the union:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
|
/* @r{Define the union @code{foo}.} */
|
||||||
|
union foo @{ int i; double d; @};
|
||||||
|
|
||||||
|
/* @r{Declare the union-valued varuable, @code{u}.} */
|
||||||
union foo u;
|
union foo u;
|
||||||
|
|
||||||
|
int x; double y;
|
||||||
|
|
||||||
u = (union foo) x @r{means} u.i = x
|
u = (union foo) x @r{means} u.i = x
|
||||||
|
|
||||||
u = (union foo) y @r{means} u.d = y
|
u = (union foo) y @r{means} u.d = y
|
||||||
|
@ -12488,9 +12494,11 @@ compilation modules, making an @dfn{object file} for that module. The
|
||||||
last step is to @dfn{link} the many object files together into a
|
last step is to @dfn{link} the many object files together into a
|
||||||
single executable for the whole program.
|
single executable for the whole program.
|
||||||
|
|
||||||
The full details of how to compile C programs (and other programs)
|
For, the full details of how to compile C programs (and other
|
||||||
with GCC are available via @url{https://gcc.gnu.org/onlinedocs/}.
|
languages' programs) with GCC, see @ref{Top,,, gcc, Using the GNU
|
||||||
Here we give only a simple introduction.
|
Compiler Collection}. On the Web, all is available through
|
||||||
|
@url{https://gcc.gnu.org/onlinedocs/}. Here we give only a simple
|
||||||
|
introduction.
|
||||||
|
|
||||||
These commands compile two compilation modules, @file{foo.c} and
|
These commands compile two compilation modules, @file{foo.c} and
|
||||||
@file{bar.c}, running the compiler for each module:
|
@file{bar.c}, running the compiler for each module:
|
||||||
|
|
Loading…
Reference in New Issue