From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20529 invoked by alias); 27 Apr 2017 11:38:06 -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 20512 invoked by uid 89); 27 Apr 2017 11:38:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1098, H*i:sk:tkrat.8, H*MI:sk:tkrat.8, H*f:sk:tkrat.8 X-HELO: mail-yw0-f175.google.com Received: from mail-yw0-f175.google.com (HELO mail-yw0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 11:38:04 +0000 Received: by mail-yw0-f175.google.com with SMTP id u70so14036610ywe.2 for ; Thu, 27 Apr 2017 04:38:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zrEurQxphlqiFU23qQEyOEnsIYQQWGGw1VELyTAIjWs=; b=d/91Zr3YcIgRPTA4kwThczl3MQEaYpleDKClkHaquy5fKkmCGtgZjNglzxmgKMmeuu MbXtD6+fKMGqGPz5ivt6OAlUUOte2spFbDz6zsdH9Ge+XrdrUXtygOJA3P/jvxIwWiks y0jB8s+LjFVHGmTWoiPbiXoMYIINzpOnojP4hXlfhrvbmPcOfe7hGTQ9xbCvjsd83+9S LF2OcZ+QNzp/XWb8ECf7+uNbFr30bUdFAmPkfM2RgCJne7YesWoNzp7b6bh22binGjes zU4f/w1Zgup2JEajgsHf5Cu3A6Hf4vutXRhkWR4/GsEmxZD1JfrKoY22MwJ74LafBoZ6 Ff/A== X-Gm-Message-State: AN3rC/7807kaTHEEp+P9+gJh6/bYUIr5qH6jbKDbsNULEp3X+DgSP8xf 0HHmcQfp7cAuGw== X-Received: by 10.129.115.212 with SMTP id o203mr3857428ywc.55.1493293085234; Thu, 27 Apr 2017 04:38:05 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::b:7639]) by smtp.googlemail.com with ESMTPSA id m184sm1307876ywm.9.2017.04.27.04.38.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Apr 2017 04:38:04 -0700 (PDT) Subject: Re: [PATCH] Improved diagnostics for casts and enums To: Volker Reichelt , gcc-patches@gcc.gnu.org References: From: Nathan Sidwell Message-ID: Date: Thu, 27 Apr 2017 12:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-04/txt/msg01385.txt.bz2 On 04/27/2017 03:29 AM, Volker Reichelt wrote: > Hi, > > the following two patches aim at improving GCC's diagnostics to help > the user to get rid of old-style casts. While old-style pointer casts > are really bad and need to be weeded out quickly, old-style casts between > arithmetic types are IMHO much more tolerable. The patches allow to > easily distinguish between those situations. > > The first patch for cp_parser_cast_expression in parser.c just adds > the target type of the cast to the diagnostic (like in > maybe_warn_about_useless_cast in typeck.c). > > The second patch for type_to_string in error.c tackles the problem > that the name of a type doesn't tell you if you have a class or just > a simple enum. Similar to adding "{aka 'int'}" to types that > are essentially integers, this patch adds "{enum}" to all > enumeration types (and adjusts two testcases accordingly). > > Bootstrapped and regtested on x86_64-pc-linux-gnu. > > OK for trunk (as two patches or as one)? ok. One commit is fine. nathan -- Nathan Sidwell