------- Additional Comments From rsandifo at gcc dot gnu dot org  2005-05-05 
07:11 -------
I'm confused by this report.  You use:

    *((int32_t *) a.unaligned_int) = 0x123456;

which reads the value of a.unaligned_int, casts it from an integer
to a pointer, and then dereferences the pointer.  Why do you expect
the store to be unaligned?  There's no reason to assume that,
just because the address was stored in an unaligned location,
the thing it points to is also unaligned.

Did you mean to write &a.aligned_int instead?  If so, then like
Andrew says, that's invalid.  You can't access an unaligned object
(a.unaligned_int) as though it had an aligned type (int32_t).

Richard

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21387

Reply via email to