From owner-freebsd-arm@FreeBSD.ORG Mon Jul 21 20:11:47 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF2D9A4D; Mon, 21 Jul 2014 20:11:47 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5312EC9; Mon, 21 Jul 2014 20:11:47 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 8F4331578; Mon, 21 Jul 2014 20:04:46 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id s6LK4hPp038241; Mon, 21 Jul 2014 20:04:44 GMT (envelope-from phk@phk.freebsd.dk) To: Bruce Evans Subject: Re: [CFR] mge driver / elf reloc In-reply-to: <20140722041517.M3229@besplex.bde.org> From: "Poul-Henning Kamp" References: <14D22EA6-B73C-47BA-9A86-A957D24F23B8@freebsd.org> <1405810447.85788.41.camel@revolution.hippie.lan> <20140720220514.GP45513@funkthat.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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <38239.1405973083.1@critter.freebsd.dk> Date: Mon, 21 Jul 2014 20:04:43 +0000 Message-ID: <38240.1405973083@critter.freebsd.dk> Cc: Tim Kientzle , Ian Lepore , arch@freebsd.org, freebsd-arm , Fabien Thomas X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 20:11:48 -0000 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.