1785
A
1786
A
1787
A
1788
A function may have any number of
1789
If a
1790 If the expression has a type different from the return type of the function in which it appears, the value is converted as if by assignment to an object having the return type of the function.136)
1791 EXAMPLE In:
struct s { double i; } f(void);
union {
struct {
int f1;
struct s f2;
} u1;
struct {
struct s f3;
int f4;
} u2;
} g;
struct s f(void)
{
return g.u1.f2;
}
/* ... */
g.u2.f3 = f();
there is no undefined behavior, although there would be if the assignment were done directly (without using a function call to fetch the value).
1792
136) The
1793 The overlap restriction of subclause 6.5.16.1 does not apply to the case of function return.
Next
Created at: 2005-06-29 02:19:03
The text from WG14/N1124 is copyright © ISO