Strict-aliasing rules (gcc 4.4)

Julien ÉLIE julien at trigofacile.com
Thu Aug 20 21:43:07 UTC 2009


Hi,

With gcc 4.4, there are lots of errors like:

rc.c:151: error: dereferencing pointer 's_local' does break strict-aliasing rules
rc.c:573: error: dereferencing pointer 'remote.59' does break strict-aliasing rules
...


-->  if( s_local->sa_family == AF_INET6 )
     {
       struct sockaddr_in6 *s_l6 = (struct sockaddr_in6 *)s_local;
       struct sockaddr_in6 *s_d6 = (struct sockaddr_in6 *)s_distant;


--> memcpy(&remotetable[i].Address, &remote, SA_LEN((struct sockaddr *)&remote));


What could we do for that?
Why such calls are not fine?

-- 
Julien ÉLIE

« -- Ne te réjouis pas trop vite... Gnôthi seauton !
  -- Ça veut dire quoi ça ?
  -- Je ne sais pas ; c'est du grec. » (Oursenplus) 




More information about the inn-workers mailing list