Re: Endianness conversion functions

Krister Walfridsson <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>

On Thu, 18 Jan 2007, Christian Biere wrote:

> are there any objections against the patch below? These could then
> completely replace the almost identical code in sys/fs/cd9660/iso.h
> as well as sys/fs/msdosfs/bpb.h and -DUNALIGNED_ACCESS could be removed
> from the relevant Makefiles.

This breaks the C aliasing rules [*], so I would prefer to instead
change sys/fs/cd9660/iso.h and sys/fs/msdosfs/bpb.h to use a correct
implementation (using e.g. memcpy, which for sufficiently new gcc
should generate as efficient code but without the potential lossage
arising from aliasing issues.)  Or use the current sys/sys/endian.h
implementation.  Does it really give a measurable slow down in real
life?

    /Krister


[*] That statement is a bit oversimplified.  See e.g. my old mail
  http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html
for a more detailed discussion.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.