From patchwork Fri May 19 13:58:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9737333 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 DCA6D601A1 for ; Fri, 19 May 2017 13:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D604E2888B for ; Fri, 19 May 2017 13:58:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA45A28927; Fri, 19 May 2017 13:58:56 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 517AD2888B for ; Fri, 19 May 2017 13:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbdESN6z (ORCPT ); Fri, 19 May 2017 09:58:55 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35009 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbdESN6z (ORCPT ); Fri, 19 May 2017 09:58:55 -0400 Received: by mail-wm0-f67.google.com with SMTP id v4so18552161wmb.2 for ; Fri, 19 May 2017 06:58:54 -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; bh=vGcKQaHzs/eBoe3BuxL05CnX6eTscOxOkpFfTdDesJg=; b=NAWWiADIJH5nVijzYolpgvX7au9a1TD03QgybshIsAWzliDI4HK96UWdT7GkXHXs9L ZnAJoBaUiaVzaRy7p0SdZLLL/JikYTRP7DxkuUa0H09EfWvK9/VwrUUiO5vLl8aXSf9s LYf0gLMwlQzWLrE4cPF2Y8uZyOwgjdL4zllWu+Js964p3Z7a6B1I6MkniLTLDsIft2dJ 9kad0ifljoZ9fQl+Sz9z05EnvLcDkgoh6NI68bKMtNd7VRHqewFX1ilIneIFblQxx3o7 UAQOdS/gUwHFMtI0f6ABVlyPPmYSLA1kC+fuYt9Eb/DWa89B4KTyeByLzym0MItWXvbk 3hMg== 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; bh=vGcKQaHzs/eBoe3BuxL05CnX6eTscOxOkpFfTdDesJg=; b=Ls0Ry8sUnfKPcgaVYUSuMfAepGhxs2at/u9RCeeGMIl/FMY6zjDU90bJNK3DnoYtHi 49ysh3sbfRDgeHqJsUaL00l5uR2VvkIKLWlXKgg4UnhRVtYW9jgjdlLFJnODW2YqoKIK SA2vyDraz65gKd/Rf+L1JbaLGq8raZk1e8WBqNKA/yWIUHvvkW//3iA0612Ydi103WAs EtpVL49XnRPEXl/2zRsQ5XotICEta/dRLUCrJ4KNVapufd7uEFC+tPrZUeZoS2dVIv+B NT8vPoY5XcSD09eDJKBIGyq1yKzsXqRSpGw4BR1pCBpLXnkzQd1cszVK7v8ILfPk7khG 4e/w== X-Gm-Message-State: AODbwcDA10H0FHMLURb6BwjwodyW54ZQS84paNvSnuM7aQ71BP0WOXeT Z2Urx05j8JrML8YirJI= X-Received: by 10.80.165.194 with SMTP id b2mr7258712edc.84.1495202333668; Fri, 19 May 2017 06:58:53 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:82d:ce00:d850:21e6:e0a6:5c5a]) by smtp.gmail.com with ESMTPSA id t55sm3147993edd.23.2017.05.19.06.58.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 06:58:52 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Luc Van Oostenryck , Al Viro Subject: [PATCH] RFC: remove warning "advancing past deep designator" Date: Fri, 19 May 2017 15:58:47 +0200 Message-Id: <20170519135847.40720-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 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 This warning is issued in code like: struct s { union { int i; long l; } u; int b; }; static struct s s = { .u.i = 1, 2, }; in other words, it is issued when a 'deep' designated initializer is followed by a non-designated initializer. I wonder what's really the value of this warning. Is there really some confusion we would like to avoid? NB. I'm not sure if this situation is covered by the standard (status of 'deep' designated initializers is not very clear). NB. GCC accept this, without any option to warn about it. CC: Al Viro Signed-off-by: Luc Van Oostenryck --- evaluate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/evaluate.c b/evaluate.c index f8ed10f13..ef4da2371 100644 --- a/evaluate.c +++ b/evaluate.c @@ -2501,10 +2501,6 @@ static void handle_list_initializer(struct expression *expr, ctype->ident ? ": " : "", get_type_name(struct_sym->type), show_ident(struct_sym->ident)); - if (jumped) { - warning(e->pos, "advancing past deep designator"); - jumped = 0; - } REPLACE_CURRENT_PTR(e, last); } else { next = check_designators(e, ctype);