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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8259C433FE for ; Sat, 12 Nov 2022 18:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235063AbiKLSa7 (ORCPT ); Sat, 12 Nov 2022 13:30:59 -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 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