Actually, that's not entirely correct. I have seen some architectures that will turn a shift into a nop when the shift width is greater than the word size. I have some ARM boards that I can cross compile for, so I'll take a look at cleaning up the warnings when I get some time this weekend.
Thanks, Owen
On 14-04-11 06:39 AM, Niels Möller wrote:
nisse@lysator.liu.se (Niels Möller) writes:
Pushed now, with some smaller changes.
I get a couple of warnings, when compiling for 32-bit platforms, e.g., ARM.
/home/nisse/hack/nettle/ccm.c: In function `nettle_ccm_set_nonce': /home/nisse/hack/nettle/ccm.c:134:3: warning: comparison is always false due to limited range of data type [-Wtype-limits] /home/nisse/hack/nettle/ccm.c:138:5: warning: right shift count >= width of type [enabled by default] /home/nisse/hack/nettle/ccm.c:139:5: warning: right shift count >= width of type [enabled by default] /home/nisse/hack/nettle/ccm.c:140:5: warning: right shift count >= width of type [enabled by default] /home/nisse/hack/nettle/ccm.c:141:5: warning: right shift count >= width of type [enabled by default]
As long as it's "always false", the code should be correct, but it would be nice to get rid of these warnings.
Regards, /Niels