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



On Nov 17,  1:37am, tsutsui%ceres.dti.ne.jp@localhost (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/sys/arch/atari/stand/installboot

| Then what's your point? 
| Should we always strictly use memcpy even in MD code you won't maintain?
| 
| If you really don't like current code, I'd still like to keep
| the original casts with -fno-strict-aliasing, instead of memcpy
| because my goal is just "to switch m68k ports to using gcc48 by default
| in netbsd-7," not playing with modern compiler and C specifications.

I don't understand why you are so much against the memcpy. This is
what we were already doing with the cast (before it became undefined
behavior) and the language definition mandates it. It is not like
the compiler has to warn about pointer aliasing, or that
-fno-strict-aliasing will work with every compiler... Or even in
the next version of gcc. We fix the warnings to future-proof the code.

| The formar can be easily changed
|  *(uint16_t *)p = htobe16(v);
| but the latter can't. You might be able to use functions like
| host16enc and target16enc for streaming data, but the target
| cksum is not stream but just calculated in uint16_t.

I am sure we can fix the code in a way that it is both readable and correct.
Leaving it the way it was, is not an option.

christos


Home | Main Index | Thread Index | Old Index