From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2618C433E0 for ; Tue, 2 Jun 2020 03:53:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4DC5520734 for ; Tue, 2 Jun 2020 03:53:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="l5Ps/+Xe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DC5520734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CC98080007; Mon, 1 Jun 2020 23:53:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C53078E0006; Mon, 1 Jun 2020 23:53:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1C1E80007; Mon, 1 Jun 2020 23:53:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id 96A748E0006 for ; Mon, 1 Jun 2020 23:53:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 48F8B8248047 for ; Tue, 2 Jun 2020 03:53:27 +0000 (UTC) X-FDA: 76882902054.14.tray77_fc2e66a3c53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 234FB18229835 for ; Tue, 2 Jun 2020 03:53:27 +0000 (UTC) X-HE-Tag: tray77_fc2e66a3c53 X-Filterd-Recvd-Size: 4275 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Jun 2020 03:53:26 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id r10so4458792pgv.8 for ; Mon, 01 Jun 2020 20:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=+W+sJwBAjsDfFb5YZj8JOopdREyXuR/NlYpbtmAv/3A=; b=l5Ps/+XeOXjshxw8zP+aM2rMqcNk4TmSn/7itoTOIQsDFxBF4ktd/Peal0iezIlE27 hPJd4nH66vZm93kGHVaAs0sxJa73Cyskqo6Z3HPT7hYK279VSQCLxG/nSMf6AVothqES wkXFf1ia/JHRIGPB/uHfaNaC/of+E89seNV7U= 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:in-reply-to:references:date :message-id:mime-version; bh=+W+sJwBAjsDfFb5YZj8JOopdREyXuR/NlYpbtmAv/3A=; b=JxubZpahLka3SbyWeBOjNTi/tiu/giT1VzMapU59QxKrX+2zYtIUkR6UOOcW6cv6Wv GSQbyEqF10Yz/M08MafGGJoAGKa7HH7ZXq5QvCm6uK3BRHyfI6o6BiksDj4Go+cQ2osm MTN04Pl8HFrA+nJAhL5gquMXX9jeT3vc1gxvl86nftD3/PbjS/vHgVJpKLm33kJgKBIX F/6AOhCZouhs7hMQLNaHhrwEt6E81dXQgne0+8riUOBpqjEObWaZk+MDEn68avrQ68IS EHwUW1+LmJSr/pEw7JchrR2LipV2vfzUXw8sWaTL2lr83TXaFe+b5ZNc8cSEbr49ja8u pUoA== X-Gm-Message-State: AOAM531KsNFqAoZgO/wl3akOKhNgfsrsvkshuJ8H+2mvPYfZSa6Fz2AU AM5pgSfBcLMoTf/b5UR676yNUw== X-Google-Smtp-Source: ABdhPJzWE3iQlXHlICiQWtnCNmXf7dHjdJ5/0/yQkLXAhrYCaFdQNpaUpraEsUElatyK9YW1UIBFZg== X-Received: by 2002:a62:cf01:: with SMTP id b1mr11312605pfg.84.1591070005564; Mon, 01 Jun 2020 20:53:25 -0700 (PDT) Received: from localhost (2001-44b8-1113-6700-8c2c-9602-4cd1-9ff4.static.ipv6.internode.on.net. [2001:44b8:1113:6700:8c2c:9602:4cd1:9ff4]) by smtp.gmail.com with ESMTPSA id k14sm813127pfu.78.2020.06.01.20.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 20:53:25 -0700 (PDT) From: Daniel Axtens To: Andrew Morton , kbuild test robot Cc: kbuild-all@lists.01.org, Johannes Weiner , Dmitry Vyukov , Linux Memory Management List Subject: Re: [hnaz-linux-mm:master 169/698] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' In-Reply-To: <87wo4qywp4.fsf@dja-thinkpad.axtens.net> References: <202005301819.G4uARaFJ%lkp@intel.com> <20200601180455.1a2f38368da33c7a0bb8d6fb@linux-foundation.org> <87wo4qywp4.fsf@dja-thinkpad.axtens.net> Date: Tue, 02 Jun 2020 13:53:22 +1000 Message-ID: <87tuzuyvgt.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 234FB18229835 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Daniel Axtens writes: > Hi Andrew, > >>> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation] >>> 297 | #define __underlying_strncpy __builtin_strncpy >>> | ^ >>> >> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' >>> 307 | return __underlying_strncpy(p, q, size); >>> | ^~~~~~~~~~~~~~~~~~~~ >> >> Looks like another false positive. >> >> Daniel, is there a practical way of suppressing these? > > I think we probably want '-Wno-stringop-truncation'. That will stop > warnings where the bound equals the destination size (so there won't be > any null-truncation). But it won't stop the overflow warnings about > full-on overflows (-Wstringop-overflow). Ah, so both stringop-truncate and stringop-overflow are disabled in Makefile: - commit 5a76021c2eff ("gcc-10: disable 'stringop-overflow' warning for now") - commit 217c3e019675 ("disable stringop truncation warnings for now") However, at W=1, stringop-truncate is re-enabled - last touched commit 64a91907c896 ("kbuild: refactor scripts/Makefile.extrawarn"). That would explain why we see this on test builds with W=1 only. I'll bump it to W=2. > I'll send a patch. > > Regards, > Daniel