From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OSvyL-00034D-Rx for garchives@archives.gentoo.org; Sun, 27 Jun 2010 17:48:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD2C4E0C8E; Sun, 27 Jun 2010 17:48:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A496EE0ACF for ; Sun, 27 Jun 2010 17:48:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 4402D1B408D for ; Sun, 27 Jun 2010 17:48:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -0.225 X-Spam-Level: X-Spam-Status: No, score=-0.225 required=5.5 tests=[AWL=-3.086, BAYES_00=-2.599, RCVD_IN_BL_SPAMCOP_NET=1.96, RCVD_IN_NIX_SPAM=3.5] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id olARDNdQ87Id for ; Sun, 27 Jun 2010 17:48:29 +0000 (UTC) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by smtp.gentoo.org (Postfix) with ESMTP id 77EC91B40A5 for ; Sun, 27 Jun 2010 17:48:28 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OSvxv-0007o5-4J for gentoo-dev@gentoo.org; Sun, 27 Jun 2010 19:48:23 +0200 Received: from athedsl-376750.home.otenet.gr ([79.131.23.172]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Jun 2010 19:48:23 +0200 Received: from realnc by athedsl-376750.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Jun 2010 19:48:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-dev@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-dev] Re: FYI: Rules for distro-friendly packages Date: Sun, 27 Jun 2010 20:48:25 +0300 Organization: Lucas Barks Message-ID: References: <4C252C8E.8020408@gentoo.org> <20100626193915.GD4789@nibiru.local> <20100626205001.365b51cb@snowcone> <20100626195733.GF4789@nibiru.local> <20100626211254.002784d4@snowcone> <20100627104724.GC23460@nibiru.local> <20100627122258.GA8754@boostbox> <20100627171454.GA2656@boostbox> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-376750.home.otenet.gr User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100626 Thunderbird/3.1 In-Reply-To: <20100627171454.GA2656@boostbox> Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 95188ce7-36ad-4946-9a72-a5536c6b4b5e X-Archives-Hash: 782de6b2a21a8f218ce15c5805a7ec0e On 06/27/2010 08:14 PM, Harald van D=C4=B3k wrote: > On Sun, Jun 27, 2010 at 05:46:28PM +0300, Nikos Chantziaras wrote: >> On 06/27/2010 03:23 PM, Harald van D=C4=B3k wrote: >>> The compiler is not totally free to ignore the register keyword. >>> Both the C and the C++ standards require that the compiler complain >>> when taking the address of a register variable. Other compilers will >>> issue a hard error for it. Fixing the code to not declare the >>> variable as register would be the correct thing to do. >> >> No, it would not be the correct thing to do, because of the following. >> (This is part of a discussion between me and someone quite smarter tha= n >> me, who explained the issue in detail.) >> >> [snip] > > That explanation seems to be written by someone who does not know that > taking the address of a register variable is simply not allowed. It is allowed. Section 7.1.1, Paragraphs 2 and 3 of the C++ standard: The register specifier [...] specifies that the named variable has=20 automatic storage duration (3.7.3). A variable declared without a=20 storage-class-specifier at block scope or declared as a function=20 parameter has automatic storage duration by default. A register specifier is a hint to the implementation that the variable=20 so declared will be heavily used. [ Note: the hint can be ignored and in=20 most implementations it will be ignored if the address of the variable=20 is taken. This use is deprecated (see D.4). =E2=80=94 end note ] >> OK, long read, but the the conclusion is that "fixing the code to not >> declare the variable as register would be the correct thing to do" it >> *not* the correct thing to do. The correct thing to do is to ignore t= he >> warning, which is not possible if warnings are turned into errors. > > And which is not possible if the warning is a hard error in the first p= lace. > >> You also mentioned that "other compilers will issue a hard error for >> it." That sounds rather strange, and I wonder which compilers that >> might be; someone should file a bug report against them ;) > > Well, let's start with gcc; that's quite an important one for Gentoo... That code compiles just fine. I don't know of any GCC version that=20 issues an error for this rather than just a warning.