From owner-freebsd-ports@FreeBSD.ORG Mon Sep 5 02:13:29 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D504106564A for ; Mon, 5 Sep 2011 02:13:29 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id EEB718FC0A for ; Mon, 5 Sep 2011 02:13:28 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id p852DRFN099806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 4 Sep 2011 19:13:28 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id p852DRfe099805; Sun, 4 Sep 2011 19:13:27 -0700 (PDT) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA15717; Sun, 4 Sep 11 19:09:46 PDT Date: Mon, 05 Sep 2011 02:09:36 -0700 From: perryh@pluto.rain.com To: matthias.andree@gmx.de Message-Id: <4e6491d0.MNLKNzL63JK0kXDG%perryh@pluto.rain.com> References: <20110725155920.GA83490@freebsd.org> <4E631DBF.9000106@yandex.ru> <20110904101252.526de5ef@nonamehost.> <4E632A09.8060904@FreeBSD.org> <20110904114550.71c63078@nonamehost.> <4E63516B.7000805@FreeBSD.org> <20110904130659.7a94cce8@raksha.tavi.co.uk> <4E637DD8.50700@gmx.de> In-Reply-To: <4E637DD8.50700@gmx.de> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: reasons for rewriting regular memory (was: [ANNOUNCE]: clang compiling ports, take 2) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 02:13:29 -0000 Matthias Andree wrote: > > I agree, but I can think of another valid exception. System with > > Hamming correction on the memory, gets a single bit (correctable) > > error. Need to rewrite the memory contents to reset all the parity > > bits! > That's a matter of the EDAC stuff, not the business of applications. True, but it may explain why clang does not flag "*x = *x;" when it does flag "x = x;". A compiler cannot know the context in which the compiled code will be used. BTW I agree that an understanding is needed of _why_ the code in question was included. I have seen "x = x;" -- x being a formal parameter -- used to prevent an "unused argument" warning in a function which did not in fact need the argument in question, but had to declare it for uniformity with other functions pointed to by the same function pointer type.