Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 2014 20:04:43 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Tim Kientzle <tim@kientzle.com>, Ian Lepore <ian@freebsd.org>, arch@freebsd.org, freebsd-arm <freebsd-arm@freebsd.org>, Fabien Thomas <fabient@freebsd.org>
Subject:   Re: [CFR] mge driver / elf reloc
Message-ID:  <38240.1405973083@critter.freebsd.dk>
In-Reply-To: <20140722041517.M3229@besplex.bde.org>
References:  <14D22EA6-B73C-47BA-9A86-A957D24F23B8@freebsd.org> <1405810447.85788.41.camel@revolution.hippie.lan> <20140720220514.GP45513@funkthat.com> <F6D53A17-FED0-4F08-BB5B-9F66C5AF5EF6@kientzle.com> <20140720231056.GQ45513@funkthat.com> <9464C309-B390-4A27-981A-E854921B1C98@bsdimp.com> <20140721162559.GS45513@funkthat.com> <467619B1-F530-49AF-91BF-14CA3A31908B@bsdimp.com> <20140722041517.M3229@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20140722041517.M3229@besplex.bde.org>, Bruce Evans writes:

>This seems to make most of byteorder(9) a mistake.  Just about everything
>can be done better using memcpy() and standard functions in byteorder(3),

Covered by Bruce' "just about" is that code analysers like Coverity
and FlexeLint cannot see through his proposed version of the macros
on little-endian architectures because of the inline assembler used
to access the exchange instructions which the C-compiler do not expose.

Analysers have no such problems with the pure-C versions there today.

The real fault is with the ISO-C people who still lives in a world
where endianess doesn't exist.

If they had done their job sensibly, variables, including members
of structs, could be declared as having a specific storage-layout.

My theory is that they confident the PDP-10 and CRAY-1 are just
about to make a comeback...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38240.1405973083>