------- Additional Comments From rsandifo at gcc dot gnu dot org  2005-05-05 
12:01 -------
> Reading your reply further, I understand that the behavior I observere is
> correct and related to the fact that the 'int32_t' type is assumed to be
> aligned.

Right.

> It is not a bug then, but merely a bit of a problem for me. Is there a
> typecast to tell the compiler that the adress references an unaligned
> integer, i.e. something like int32_unaligned_t?

'Fraid not.  The "packed" attribute can't be applied to scalars
(and would in any case interfere a bit with the type system).
I think the best you can do is define a packed struct containing
a single int32_t field.  Yes, it will clutter the code a bit,
but it will be type-safe.

Richard


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
         Resolution|                            |INVALID


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

Reply via email to