Menu ▾ ▴

#124 warning: dereferencing type-punned pointer will break strict-aliasing rules

Patch
closed-fixed
None
5
2016-04-12
2015-05-05
No

Compiling gsoap results in warnings about broken strict aliasing rules.

stdsoap2_ssl.c: In function 'soap_rand':
stdsoap2_ssl.c:3112:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return *(int*)buf;
   ^

stdsoap2_ssl_cpp.cpp: In function 'int soap_rand()':
stdsoap2_ssl_cpp.cpp:3112:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return *(int*)buf;
                 ^

../../plugin/wsaapi.c: In function 'soap_wsa_rand_uuid':
../../plugin/wsaapi.c:602:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   r2 += *(int*)soap->buf;
   ^

Patch attached.

1 Attachments

Discussion

  • Mattias Ellert

    Mattias Ellert - 2016-01-21

    Updated patch - missing parentheses.

     
  • Robert van Engelen

    • status: open --> closed-accepted
     
  • Robert van Engelen

    • status: closed-accepted --> closed-fixed
     

Log in to post a comment.