From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56183 invoked by alias); 7 Feb 2018 09:59:24 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 56170 invoked by uid 89); 7 Feb 2018 09:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=countermanded, prescriptive, H*i:sk:8Z5BSw@, H*i:FKk X-HELO: smtp03.uc3m.es Received: from smtp03.uc3m.es (HELO smtp03.uc3m.es) (163.117.176.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Feb 2018 09:59:22 +0000 Received: from smtp03.uc3m.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B842DC084; Wed, 7 Feb 2018 10:59:19 +0100 (CET) Received: from smtp03.uc3m.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D8BEDC06D; Wed, 7 Feb 2018 10:59:19 +0100 (CET) Received: from triangulo.it.uc3m.es (unknown [163.117.139.109]) by smtp03.uc3m.es (Postfix) with ESMTPS; Wed, 7 Feb 2018 10:59:19 +0100 (CET) Received: from nbd.it.uc3m.es (root@nbd.it.uc3m.es [163.117.139.192]) by triangulo.it.uc3m.es (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id w179xIkP005993 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 7 Feb 2018 10:59:19 +0100 Received: from nbd.it.uc3m.es (localhost [127.0.0.1]) by nbd.it.uc3m.es (8.13.1/8.13.1/Debian-15) with ESMTP id w179xFOw012196; Wed, 7 Feb 2018 10:59:15 +0100 Received: (from ptb@localhost) by nbd.it.uc3m.es (8.13.1/8.13.1/Submit) id w179xFTa012194; Wed, 7 Feb 2018 10:59:15 +0100 From: "Peter T. Breuer" Message-Id: <201802070959.w179xFTa012194@nbd.it.uc3m.es> Subject: Re: signed/unsigned integer conversion for right shift seems To: jwakely.gcc@gmail.com (Jonathan Wakely) Date: Wed, 07 Feb 2018 09:59:00 -0000 Cc: tadeus.prastowo@unitn.it (Tadeus Prastowo), ptb@inv.it.uc3m.es (Peter Breuer), Peter.T.Breuer@gmail.com (Peter Breuer), lh_mouse@126.com (Liu Hao), gcc-help@gcc.gnu.org (gcc-help) In-Reply-To: from "Jonathan Wakely" at Feb 06, 2018 08:15:48 PM X-Anonymously-To: Reply-To: ptb@inv.it.uc3m.es X-WebTV-Stationery: Standard\; BGColor=black\; TextColor=black Reply-By: Sat, 1 Apr 2006 14:21:08 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-imss-scan-details: No--15.537-5.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1689-8.2.1013-23646.006 X-TMASE-Result: 10--15.537400-10.000000 X-TMASE-MatchedRID: csPTYAMX1+Ev2k3M27J31vHkpkyUphL9ix+K88kLVD2KlJ71TX9+gzqF lxhj7txClJdwBaRvjXloZQqEInd2V+clkHpA7KA8fuyIS1ZjfrsZbpN+hw0Ke0NjyV5Hn/ECJOt KVtVlNAr9j0d9lN9sik/4VdQzNGXk1OGXhAFLw8up4G6k2AuBh4ED+PNzPecBKAzGd8VeOIhZMU fzivhwNCmqJY7+QFbXnagtny7ZPcRNfs8n85Te8v7E6GNqs6ce3QfwsVk0UbslCGssfkpInQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-SW-Source: 2018-02/txt/msg00050.txt.bz2 "Also sprach Jonathan Wakely:" > > On 6 February 2018 at 20:08, Tadeus Prastowo wrote: > > Jonathan is not attacking you. > > Well I am now, because he's insisting on continuing his off-topic > wanderings through the C standard. The question is if gcc is following the C standard. You are counselled not to do the attacking thing, unless you would like to be e-sat on and e-fingered by the e-police, or just generally villified and derided as that e-wit throughout the Internet and the e-iverse in general. To summarize what we know: 6.1.3.8 of many C standards contains a list of for what operators conversions should be applied "automatically", which means "without a cast", which means "implicitly". That list is prescriptive except inasmuch as it is countermanded and/or overridden by the one-by-one details of the operators in 6.5. There is nothing else that applies, as the authority at the start of section 6.1 says. That is all. In the case that I used to exemplify the situation, there are no promotions (ints are already the args) and there are no conversions because >> is not listed for conversions in 6.1.3.8 AND its own paragraph in 6.5 does not say "conversions" (it says "promotions" instead) AND 6.1 says that is all. Done. Exercise - try it with long long int in place of int. Thank you for your contribution. Regards PTB