Re: Question about size and memory layout of a Union.
> > Just to make sure:
> > The question itself specifies that the machine is little endian and
> > has a 32-bit word alignment for memory access and an unsigned integer
> > is 32 bit long. Does that make the answers explicit/valid, or are the
> > answers still implementation specific?
>
> Well, your answers demonstrate one reasonable response to the code by an
> implementation on such a platform. Possibly the *most* reasonable
> response. Unfortunately for the purpose of your question, the C Standard
> does not require that implementations must be reasonable; it requires only
> that they act in accordance with the Standard. And it is certainly
> possible - even easy - to imagine answers different to yours that are
> still in accordance with the Standard, even on such hardware as you
> specify.
Thanks again for your answers!
Could you give some "easy" examples of how the answers could be
different while still running on the specified hardware?
BRs!
|