On 2008-02-15, Oleg Verych <[email protected]> wrote:

>> If you have to deal with data layed out like that, there's
>> nothing you can do besides doing byte-by-byte access of the
>> misaligned fields.  You simply can't have both u1 and u2
>> aligned.
>
> This is problem of high-level design, or blame whatever you
> want (e.g. 8-bit past, Intel+MS hegemony, C and its
> "implementation-defined"), but not msp430 toolchain.

Correct.  The problem is not the fault of the msp430 toolchain.

However, other toolchains (including other gcc targets) provide
a solution to the problem, while the msp430 toolchain does not.  
What's worse is the compiler _pretends_ to implement a solution
by siliently emitting incorrect code.

IMO, since the packed struct feature works correctly on other
gcc targets it's quite reasonable for an mspgcc user to expect
that packed structs work on the msp430 target. A bug is when a
product doesn't do what a user reasonably expects it to do --
regardless of the intentions of the developers.  If you're not
going to implemenent accesses to fields of packed structs, then
it should be an error when the user attempts to do so.

> C was meant to be a macro-language for PDP-11 or something
> like that.

No it wasn't.  C was always a compiled language, and it
predates the PDP-11.

-- 
Grant Edwards                   grante             Yow! I brought my BOWLING
                                  at               BALL -- and some DRUGS!!
                               visi.com            


Reply via email to