U
Udi
Hi All,
I'm not sure I understand the difference between placing the
__unaligned before or after the *:
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.
with no __unaligned keyword --> Warning C4366
```````````````````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List * pSubscribersList = NULL;
pSubscribersList = (List *)&(p->subscribersList); //C4366: The result
of the unary '&' operator may be unaligned
List_Clear(pSubscribersList);
__unaligned before the * --> warning C4090
```````````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List __unaligned * pSubscribersList = NULL;
pSubscribersList = (List __unaligned *)&(p->subscribersList);
List_Clear(pSubscribersList); //warning C4090: 'function' : different
'__unaligned' qualifiers
__unaligned after the * --> no warnings
````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List * __unaligned pSubscribersList = NULL;
pSubscribersList = (List * __unaligned)&(p->subscribersList);
List_Clear(pSubscribersList); // OK - no warning
Can anyone explain what's the difference between the last two
examples?
I'm using VS2005 compiling to 64 bit.
Thanks!
I'm not sure I understand the difference between placing the
__unaligned before or after the *:
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.
with no __unaligned keyword --> Warning C4366
```````````````````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List * pSubscribersList = NULL;
pSubscribersList = (List *)&(p->subscribersList); //C4366: The result
of the unary '&' operator may be unaligned
List_Clear(pSubscribersList);
__unaligned before the * --> warning C4090
```````````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List __unaligned * pSubscribersList = NULL;
pSubscribersList = (List __unaligned *)&(p->subscribersList);
List_Clear(pSubscribersList); //warning C4090: 'function' : different
'__unaligned' qualifiers
__unaligned after the * --> no warnings
````````````````````````````````````````````````````````
void List_Clear(List *pList) ;
:
List * __unaligned pSubscribersList = NULL;
pSubscribersList = (List * __unaligned)&(p->subscribersList);
List_Clear(pSubscribersList); // OK - no warning
Can anyone explain what's the difference between the last two
examples?
I'm using VS2005 compiling to 64 bit.
Thanks!