Overlapping assignments
T. William Wells
bill at proxftl.UUCP
Thu Sep 8 10:48:49 AEST 1988
In article <3008 at tekcrl.CRL.TEK.COM> barts at tekcrl.CRL.TEK.COM (Bart Schaefer) writes:
: Suppose I make the following declaration:
:
: [declaration omitted]
:
: Given that declaration, is the following assignment guaranteed to work
: for any (integer) values of i and j (assuming a compiler that supports
: structure assignment)?
:
: some_node.n_cell[i] = some_node.n_vec.args[j];
No. If there is any possibility of overlap, you can be that some
compiler will move them in such a way as to make you miserable.
The new standard specifically states that the implementation does
not have to do such assignments correctly. See 3.3.16.1.
---
Bill
novavax!proxftl!bill
More information about the Comp.lang.c
mailing list