From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11882 invoked by alias); 25 May 2017 11:19:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 11863 invoked by uid 89); 25 May 2017 11:19:53 -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,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 May 2017 11:19:52 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B13AA17AC4B; Thu, 25 May 2017 11:19:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B13AA17AC4B Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B13AA17AC4B Received: from localhost (unknown [10.33.36.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 420BE5B83E; Thu, 25 May 2017 11:19:54 +0000 (UTC) Date: Thu, 25 May 2017 11:21:00 -0000 From: Jonathan Wakely To: Nathan Sidwell Cc: Richard Biener , gcc-patches@gcc.gnu.org Subject: Re: [libibery PATCH] Fix bootstrap Message-ID: <20170525111953.GV12306@redhat.com> References: <024459fb-b511-ec03-7b02-365804fab108@acm.org> <17d610aa-170d-6244-34df-2c4d6d577bec@acm.org> <9E1B4F12-E5F9-4C08-8E3A-44F0ABC59F8D@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017-05/txt/msg01946.txt.bz2 On 25/05/17 06:54 -0400, Nathan Sidwell wrote: >On 05/25/2017 01:29 AM, Richard Biener wrote: >>On May 25, 2017 3:22:18 AM GMT+02:00, Nathan Sidwell wrote: >>>On 05/24/2017 09:13 PM, Nathan Sidwell wrote: >>>>On 05/24/2017 08:56 PM, Nathan Sidwell wrote: >>>>>On 05/24/2017 08:34 PM, Nathan Sidwell wrote: >>>>>>We now warn on casts to T const. Applied as obvious to fix >>>bootstrap. >>>>> >>>>>And this fixes c-common.c >>>> >>>>And fix auto-profile.c >>> >>>and lto-streamer-out.c, sigh >> >>What's the reason to warn here?! > >It's a new warning about trying to cast to a const T because the const >is ignored. > >It might be better if the warning only triggered on trying to cast 'T' >to 'const T' and not trigger casting 'U' to 'const T'? I dunno. Maybe, although the language is clear that casting to (const T) means exactly the same as casting to (T) when T is a scalar type. What benefit is there to saying (const T) if the compiler ignores the const? (which the standard says it should, and I implemented in r248432).