From patchwork Wed Apr 18 15:39:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 10348515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D666B6031B for ; Wed, 18 Apr 2018 15:40:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6CFF287E0 for ; Wed, 18 Apr 2018 15:40:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5420287CD; Wed, 18 Apr 2018 15:40:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D75A287E1 for ; Wed, 18 Apr 2018 15:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753695AbeDRPkH (ORCPT ); Wed, 18 Apr 2018 11:40:07 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:39172 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753175AbeDRPkG (ORCPT ); Wed, 18 Apr 2018 11:40:06 -0400 Received: by mail-wr0-f194.google.com with SMTP id q6-v6so6079080wrd.6 for ; Wed, 18 Apr 2018 08:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pJkYtNWegMHTA2h6FPK7EFXHpPuBodoXLuO+KCRzyc0=; b=kbFAWHlYP33MX46KWCDZ50vxs8BCO3Vbm6gMQCF6u8EAkIkxdSrUf+FG4Ug/rfPOkG M1IfzDjiKt3OQkv02MiC0hkI0qu82sXp9mpmepTaLUE8R7Z0q1wv3ACBnCxrn7ONpZER 5aXr5jgr09PQhdDBJlMqdVkViaKMY6AdhvFG9jjsPhsJCzNY8b0CWkFL0/hkJcsNTfkO YNaerShPnzETTZC2LpSocSrI0cbvdME5hvRdPd0+64aoxj78FpDlxmYEbbIEqMybSwd8 CSiTtOmlLdaw8c6mrhpdUDWcK5JfxeHwL0EWdwpjL6P3IYG2QMUQtzrdNCtEUIznlP+P pXZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pJkYtNWegMHTA2h6FPK7EFXHpPuBodoXLuO+KCRzyc0=; b=gv9M2h9N0ZnaE3+7opxKmZj11xRgWXU7HaI1wLK2qXsJwv9FrjYpthdBt2TmiHVsRM G2Muf1aQhmfZp9aroV9YJYcoHYE0ZDGb0gZ3zCAX4wQS2lo2IoP+Rzpyk5BVJTSgZOip Nn42PCzWMEPVkxUZzTvZidXlMFTmZK6A9KvsW6XaHQc56k+T5v4pwJu0+485PzUIQmrH xG+edJNqVomjZzkPVSuR8On1iCmWsGbbPWW0oPeVKFEalDxCVLvlD+ts6+Cba+XkSuEm H9VNQg5UCtAa5AIR/fsFDIwKSdEQsfTDh/4LE7C0O+JRaIc5p+btHjrHjDTZCxKNF7Gs FcNw== X-Gm-Message-State: ALQs6tDf7v/bvrPDxZuNd7x5OAz7sGP7STo4XsIA3YbrwpCR1zjWL2lb hiLKIK/Lq5iiKYnD8dVj9qXagsWv X-Google-Smtp-Source: AIpwx4+eJmTDVK3UFgTganfjAGpDKOmzOipy38A8c4Zqv6PAi2uPQUo6FpwD9DEWd/0+8MWAaqbC7w== X-Received: by 10.80.145.100 with SMTP id f33mr3855392eda.29.1524066005184; Wed, 18 Apr 2018 08:40:05 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:4028:3a00:2970:4349:d805:f04e]) by smtp.gmail.com with ESMTPSA id g15sm1310727edb.69.2018.04.18.08.40.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 08:40:04 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Linus Torvalds , Matthew Wilcox , Luc Van Oostenryck Subject: [PATCH 1/3] fix show typename of enums Date: Wed, 18 Apr 2018 17:39:57 +0200 Message-Id: <20180418153959.33271-2-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180418153959.33271-1-luc.vanoostenryck@gmail.com> References: <20180418153959.33271-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently when displaying the typename of an enum this typename is first prefixed with the enum base type (most often 'int'). So displaying the type for 'enum num' will give 'int enum num'. This is a bit weird, we expect to have just the type which is 'enum num'. Change this by stopping to display the base type. Signed-off-by: Luc Van Oostenryck --- show-parse.c | 2 +- validation/enum-mismatch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/show-parse.c b/show-parse.c index 72d3f3854..ccd60a26e 100644 --- a/show-parse.c +++ b/show-parse.c @@ -342,7 +342,7 @@ deeper: case SYM_ENUM: prepend(name, "enum %s ", show_ident(sym->ident)); - break; + goto out; case SYM_NODE: append(name, "%s", show_ident(sym->ident)); diff --git a/validation/enum-mismatch.c b/validation/enum-mismatch.c index 9a929d24c..9d61f5816 100644 --- a/validation/enum-mismatch.c +++ b/validation/enum-mismatch.c @@ -13,7 +13,7 @@ static enum eb foo(enum ea a) * * check-error-start enum-mismatch.c:7:16: warning: mixing different enum types -enum-mismatch.c:7:16: int enum ea versus -enum-mismatch.c:7:16: int enum eb +enum-mismatch.c:7:16: enum ea versus +enum-mismatch.c:7:16: enum eb * check-error-end */