Re: About Union's question
- From: "Old Wolf" <oldwolf@xxxxxxxxxxxxxx>
- Date: 1 Apr 2007 17:02:36 -0700
On Apr 1, 8:40 am, CBFalconer <cbfalco...@xxxxxxxxx> wrote:
Robert Gamble wrote:
Can you provide the C&V that supports your claim of undefined
behavior given the no trap representation provision?
6.2.6.1:
... snip ...
[#7] When a value is stored in a member of an object of
union type, the bytes of the object representation that do
not correspond to that member but do correspond to other
members take unspecified values, but the value of the union
object shall not thereby become a trap representation.
This is saying that the value of the union as a whole is
not a trap, i.e. you can pass it to functions and so on.
It doesn't say that there won't be a trap if any particular
member of the union is selected.
6.5.2.3 Structure and union members
[#5] With one exception, if the value of a member of a union
object is used when the most recent store to the object was
to a different member, the behavior is
implementation-defined.70)
This text is not in C99. I suggest that if you are to use N869
as a reference then you double check things with N1124 before
posting.
.
- Follow-Ups:
- Re: About Union's question
- From: CBFalconer
- Re: About Union's question
- References:
- Re: About Union's question
- From: CBFalconer
- Re: About Union's question
- Prev by Date: Re: Reading a key inside a loop
- Next by Date: Re: when can realloc fail?
- Previous by thread: Re: About Union's question
- Next by thread: Re: About Union's question
- Index(es):
Relevant Pages
|