Udi wrote:
Quote:
I'm not sure I understand the difference between placing the
__unaligned before or after the *:
I guess, it works like 'const', which applies to the left unless it is at
the leftmost side, then it applies to the right. However, it is, as others
pointed out, non-standard, so you have to consult the compiler docs.
Quote:
I was trying to handle the C4366 warning - "The result of the unary
'&' operator may be unaligned") and used the '__unaligned' modifier as
suggested, but ended up with C4090 - "different '__unaligned' qualifiers".
(See below)
However, moving the __unaligned keyword after the ' * '
solved the warning but I'm not sure I solved the probelm.
I don't think so...
Quote:
void List_Clear(List *pList) ;
:
List * pSubscribersList = NULL;
>
pSubscribersList = (List *)&(p->subscribersList); //C4366: The result
of the unary '&' operator may be unaligned
Well, the first problem here is that you are using casts, which is typically
a sign that something's wrong. Remove those, and you won't need any
unaligned attributes. If it doesn't compile then, your types simply don't
match, but adding them doesn't change that. If you can't do it yourself or
want to verify the solution is correct, please boil your problem down to a
minimal but complete example, in particular guessing
what 'p->subscribersList' could be is pretty hart.
Uli