Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/atari/stand/installboot



christos@ wrote:

> | Taylor claims the existing abcksum() also violates aliasing rule.
> |  http://mail-index.netbsd.org/source-changes-d/2014/11/23/msg007402.html
> | 
> | If he is correct it's no sense to tweak only functions complained
> | by current gcc48.
> 
> Yes, both solutions (your post and the existing checksum function
> (with our without my changes)) violate strict aliasing rules since
> they go from uint8_t * -> void * -> uint16_t *. Currently this
> works with gcc and there are no warnings, but it is not safe.  The
> sanctioned solutions are to use unions of the memory block types
> or memcpy().

Then you don't have any patch for existing (and not warned) abcksum().
Are you also okay to specify -fno-strict-aliasing with the original code
as I and mrg (and now Taylor) suggest, rather than patching only
warned assignments?

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index