Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3714633rwb; Sat, 12 Nov 2022 11:06:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5AtPWMjWxnHEcty8qrB4/iLGaUiPqNB6zMedJF0qm0pI5uMNxj6VUXn3/u64TCkcMzydPe X-Received: by 2002:a17:903:330a:b0:187:403c:7a15 with SMTP id jk10-20020a170903330a00b00187403c7a15mr7846148plb.28.1668279985597; Sat, 12 Nov 2022 11:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668279985; cv=none; d=google.com; s=arc-20160816; b=tbXy5c7ysTAP7xvrtzZOBZmtcVRqBgfXhorNhxhv40362xk8Q0JP2zb9aSku7pfita 2E5rlc1rYIDpecUnxvY8yx7GbISeIiKh9MccXu2e0TKZWvWa/Mt3yv4jwkiIC6gXKKIU C36h6zeBfJ0tJYnHF1Wylh9I1k0LiNKWhWOhlGIguUa3NTm+z3i2ZIrdmKzE3Kyyl29S kNPvFPRMbOGqjMVfWMlF3m/fPO4JUTM7ABgX6zfIWicMrlgfZcPJ3KbPqrPjS02J7El6 ulPNNEb4Nevt31W4CliL1nHhTpOm1HfFw/boGKTBIFhYnFr5f4gpZj+ADW9LCv5vFAJB Rp4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xCaLpAuPtOE0lquE+9tk0BLisL2RiGJPnAmwhOECyok=; b=eVsRYAbqbNKu2X39PAJj1/ZqAkNOGHmZW2f5nxY7MbQPvDm7PEidQgEnvGrmk5xoZh Y25+H7kwYHL1nydqcrPG2opcJlCZeZ+JMq5epZaSG7bZaMMFfCFO1jWDrG5SJmN/A3dE TQ0fkeFyr2C+4a+P4tGzq+UBSqRJ5eu2GCgzOzPXWJLnHCO089uAn5SGOWY+PbDzxr87 eCrgb8yuj+PoExT3n1+8he8p/K2toBxSomqE2paa150L2yZwnt6jyQaWCCbogKk/n0oM PR0Ik1Hll5+BsoFaRhmrTbFhLO/omDhdBoDap/AhnTyjhe6n7QZzb1UyPovnc33byyqy wlgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Br4izro9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x64-20020a638643000000b004644f068aafsi5318822pgd.137.2022.11.12.11.06.09; Sat, 12 Nov 2022 11:06:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Br4izro9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235062AbiKLSa6 (ORCPT + 90 others); Sat, 12 Nov 2022 13:30:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234695AbiKLSa5 (ORCPT ); Sat, 12 Nov 2022 13:30:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 640CEBC0B; Sat, 12 Nov 2022 10:30:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DD7BCB80B07; Sat, 12 Nov 2022 18:30:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF9ACC433C1; Sat, 12 Nov 2022 18:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668277853; bh=/O+GXvyUlwkoQhcBoaV09K+QsmakJb5S/2ONHq+t7Jg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Br4izro987cQjAoGQRGCTgisgnFw1EXBhvx2+wdFNeoeHslvo9J0M0AdPzpui4d1A VhfPjnDUSkHw7ZLYnBiWq7uiJZzdQxbnM1Y5D4yzZ4oMeeCk4/BNYlJpv1svFLmiMJ UVmXJAauxTs5OIL+2XAa452iqXJTu5cOwmxY4o43dgdXqye5uurs5+gsStCTu/VO9m Hrcr8p45NWRdqLDUCBAqBWxhRfRrZBalmczMbpsOT3i8rvP59cwxJQYWrfFt6JeZUJ 5f15KooDvRp6abDdhvbK9ufl+QtsGFimRK/8/iVgPsEQ5Xq5NS+N6MbwyT+3hG8cpl LBud28qkOQ8rg== From: SeongJae Park To: Rong Tao Cc: sj@kernel.org, damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, rongtao@cestc.cn, shuah@kernel.org, yuanchu@google.com Subject: Re: Re: [PATCH] selftests/damon: Fix unnecessary compilation warnings Date: Sat, 12 Nov 2022 18:30:50 +0000 Message-Id: <20221112183050.85200-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rong, On Sat, 12 Nov 2022 13:01:04 +0800 Rong Tao wrote: > Hi, Park, I just search on GCC source code, found GCC support > "-Wstringop-overread" at least gcc-11.1.0, commit d14c547abd48("Add > -Wstringop-overread for reading past the end by string functions."). > > AND found a testsuite gcc/gcc/testsuite/gcc.dg/pragma-diag-10.c > > 10 #pragma GCC diagnostic push > 11 #pragma GCC diagnostic ignored "-Wstringop-overflow" > 12 #pragma GCC diagnostic ignored "-Wstringop-overread" > 13 if (c != 0) > 14 return __builtin_memchr (s, c, (unsigned long)-1); > 15 #pragma GCC diagnostic pop > > it's totally same as this PATCH. > > I think the motivation for this patch is to eliminate the compilation > warning, maybe one day we will compile the kernel with "-Werror -Wall", > at which point this compilation warning will turn into a compilation > error, and in case we already know it, we should fix this error in > advance. > > For old gcc, we can add this? > > #pragma GCC diagnostic push > +#if __GNUC__ >= 11 && __GNUC_MINOR__ >= 1 > /* Ignore read(2) overflow and write(2) overread compile warnings */ > #pragma GCC diagnostic ignored "-Wstringop-overread" > #pragma GCC diagnostic ignored "-Wstringop-overflow" > +#endif > > What do you think? I think it looks great! Looking forward to your v3 patch! Thanks, SJ > > Good day! > Rong Tao