Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2330134imm; Thu, 20 Sep 2018 11:18:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZRnBSlJzLDEnLq9c089iP8y8M7q/2GDY/kQDdmXRSCq7T2HdJkVb7GcNnRacb6pDUStQvW X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr41072343plk.127.1537467512781; Thu, 20 Sep 2018 11:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537467512; cv=none; d=google.com; s=arc-20160816; b=fT7ImlpC2iPP67T8nNMLcm1zy2IDv1YRjcewubfOf79k4HEFrSKl4G6g43ZjzpPGmQ awUfr2zLm/utqr04oLJiItIbyk8osp+gPS1pL50KjMxVIw8CIxDoWDB7DLRArl5GjB6e ySEu6A/0UdoWzLNEzBoLn6f+ajeJqyiF2F1eO5qe3wpeg5F9gTEIPo+BlMsgNd/vJy8v VEiQmzgjc81xUcj3EJBCc6D2sFnCThnoy2VPOsnfohylLO40UlagwVazbWbOLYsIcjMN i4uojguTYWgJcIdBCUOjQi1O6LoKVtaoEtPVa+dPNFvJsgz7P4d8wZu70mao243+p/Sn kDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Mh+EYBHnUkz4ClbZx5Wz1Ay+kDl2weo/gfbdbgGnZEo=; b=vtU8N8hgRse2ginzxIsGJnM1jYyCshK+rKb8EdrivV8Bpw060ct+y56DFnCXdOpnaP y9cULEc2uOM1WdlO37YzmNzl0t0g7UxvRdPpkEj5Dd2QmyBx22rSZddhWdJLGSasZrCH fj46Han8Ep+Q19sjgE5HJZ4Auy+q5Ju265LJ6fo5Ue3eB/nr4TlsbE2rVzh6ZiMbF4c4 6yTph5E9Zv/DMtiqdBolWm9UvTcipOQIQwYcdZVgQHfjaqQCurhN8rLQ7cxTsK2s6sdl 06mJkfmG/RFWPWWQAkyOf1xUoVws2vN3qLKq5HRnqbXVkbLIceseCpb1asvYv1SNcFZ3 mO+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Il+eZW1S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w126-v6si27897332pfb.232.2018.09.20.11.18.17; Thu, 20 Sep 2018 11:18:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Il+eZW1S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730139AbeIUAB2 (ORCPT + 99 others); Thu, 20 Sep 2018 20:01:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33002 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbeIUAB2 (ORCPT ); Thu, 20 Sep 2018 20:01:28 -0400 Received: by mail-pg1-f195.google.com with SMTP id y18-v6so1506057pge.0 for ; Thu, 20 Sep 2018 11:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mh+EYBHnUkz4ClbZx5Wz1Ay+kDl2weo/gfbdbgGnZEo=; b=Il+eZW1SjlkAsKADcpiWN7WlIfOJ85jbgiJRw/KQNCYi4ts8YBQe/ilBNdnARE4jwA MMJ9hMhDSXUNRIuZQeqb8RkGr1sz7Dk7NzfGyArYFviJo2dq7xlOpi7QsmwT/gcTHqHv Qc8TgI0FOaIZEb7IyzEphSnXV1W6UrWARsO4ohhKvDfcxbfQe5hE4Swpyl8lPxxubjrF 9T4ll+2CpCszhcfT9XwAN6kEd3OHpsBgcpEqCb8iK3TsRmhp5nGMwsO0nb3VejwQIzWD g0MPHoR8O1tplVu94BtUxzA/6rFPpseQSyL4c6YQr1csK+aLK7XKBRmbTasfW8uZtZ7b 5IIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mh+EYBHnUkz4ClbZx5Wz1Ay+kDl2weo/gfbdbgGnZEo=; b=esfnLMYusJeVDd++itqZofpHfq4o3CSB4xXjWOkHwQDpg1jTQLHNLeZJgf24gXUGHJ 8tChyQg21j1WvWGCQKRULp3vWRvIP7LuQZ+Fi8bI7NxoR6gim49DapJv1x0JP4D2wEGE 2raW53wXGX05r9aPvjnT4/iBZIv7uPnDDg+UlmeEKI2bKU8R2XF6/ms51H1p8G4MjKDv D2OqjnGmLpn4ZQv4j66xVZ8LmFQhsyvuG+dMlgo3TWEREb+ueaL/M9ifC9sDKw0wTkD4 qjdgdmtyQZDWyvrwzlj/XEHUMrxEz85fdZYhoQe22y9VOspciw9xhGg3IbkRZi3vuoBK hH3Q== X-Gm-Message-State: APzg51D1gSNUAiZD7T6clvF10h/xRMntm9DDlQnldYSYAjU6Q0utNGDd ovEcsYYeiTLbKlYfVuRymihmOXuMdtNtZ1l4kSQUKQ== X-Received: by 2002:a63:1363:: with SMTP id 35-v6mr38041853pgt.202.1537467403525; Thu, 20 Sep 2018 11:16:43 -0700 (PDT) MIME-Version: 1.0 References: <20180920172301.21868-1-miguel.ojeda.sandonis@gmail.com> <20180920172301.21868-14-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180920172301.21868-14-miguel.ojeda.sandonis@gmail.com> From: Nick Desaulniers Date: Thu, 20 Sep 2018 11:16:31 -0700 Message-ID: Subject: Re: [PATCH v5 13/15] Compiler Attributes: enable -Wstringop-truncation on W=1 (gcc >= 8) To: Miguel Ojeda Cc: Greg KH , LKML , adilger.kernel@dilger.ca, Masahiro Yamada , Michal Marek , rostedt@goodmis.org, mchehab+samsung@kernel.org, olof@lxom.net, konstantin@linuxfoundation.org, "David S. Miller" , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , sandipan@linux.vnet.ibm.com, Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , paul.burton@mips.com, David Rientjes , w@1wt.eu, msebor@gmail.com, sparse@chrisli.org, Jonathan Corbet , tytso@mit.edu, Geert Uytterhoeven , Rasmus Villemoes , joe@perches.com, Arnd Bergmann , asmadeus@codewreck.org, Stefan Agner , Luc Van Oostenryck , Andrew Morton , Linus Torvalds , linux-doc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 20, 2018 at 10:23 AM Miguel Ojeda wrote: > > Commit 217c3e019675 ("disable stringop truncation warnings for now") > disabled -Wstringop-truncation since it was too noisy. > > Having __nonstring available allows us to let GCC know that a string > is not meant to be NUL-terminated, which helps suppressing some > -Wstringop-truncation warnings. > > Note that using __nonstring actually triggers other warnings > (-Wstringop-overflow, which is on by default) which may be real > problems. Therefore, cleaning up -Wstringop-truncation warnings > also buys us the ability to uncover further potential problems. > > To encourage the use of __nonstring, we put the warning back at W=1. > In the future, if we end up with a fairly warning-free tree, > we might want to enable it by default. > > Signed-off-by: Miguel Ojeda > --- > scripts/Makefile.extrawarn | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn > index 8d5357053f86..b8f36f5f43f2 100644 > --- a/scripts/Makefile.extrawarn > +++ b/scripts/Makefile.extrawarn > @@ -29,6 +29,7 @@ warning-1 += $(call cc-option, -Wmissing-include-dirs) > warning-1 += $(call cc-option, -Wunused-but-set-variable) > warning-1 += $(call cc-option, -Wunused-const-variable) > warning-1 += $(call cc-option, -Wpacked-not-aligned) > +warning-1 += $(call cc-option, -Wstringop-truncation) > warning-1 += $(call cc-disable-warning, missing-field-initializers) > warning-1 += $(call cc-disable-warning, sign-compare) > > -- > 2.17.1 > I was sad to see these go in the first place. Reviewed-by: Nick Desaulniers -- Thanks, ~Nick Desaulniers