UIPEthernet: A plugin-replacement of the stock Arduino Ethernet library for ENC28J60 shields and breakout boards. Full support for persistent (streaming) TCP-connections and UDP (Client and Server each), ARP, ICMP, DHCP and DNS. Build around Adam Dunkels uIP Stack. Further developed version can be found on https://github.com/UIPEthernet/UIPEthernet
489
stars
212
forks
source link
dereferencing type-punned pointer will break strict-aliasing rules #166
they say it could cause problems:
"The strict aliasing rule makes this setup illegal, two unrelated types can't point to the same memory. Only char* has this privilege. Unfortunately you can still code this way, maybe get some warnings, but have it compile fine."
"According to the C and C++ standards, it is undefined behaviour to access a variable of a given type through a pointer to another type."
can someone explain if this can cause problems, or should i ignore it? currently i have random freezes with my setup, this is why i bother...
hello!
if i enable verbose output + warnings in arduino ide 1.6.12, i've got a lot (maybe 50+) warnings like this, when compiling:
(this is only a small part of the list)
however, i'm not on the programming level to understand these warnings, but googling around i've found this: http://stackoverflow.com/questions/4163126/dereferencing-type-punned-pointer-will-break-strict-aliasing-rules-warning
and this: http://stackoverflow.com/questions/7630150/dereferencing-type-punned-pointer-will-break-strict-aliasing-rules
they say it could cause problems: "The strict aliasing rule makes this setup illegal, two unrelated types can't point to the same memory. Only char* has this privilege. Unfortunately you can still code this way, maybe get some warnings, but have it compile fine."
"According to the C and C++ standards, it is undefined behaviour to access a variable of a given type through a pointer to another type."
can someone explain if this can cause problems, or should i ignore it? currently i have random freezes with my setup, this is why i bother...
thank you!