Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3084812rwb; Fri, 11 Nov 2022 21:53:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf65e6VYdU6qQspNQBJTzdxxdTc1Ye9vMsHYakAck0plP3CN5AQwjAFA05rqZ9WYgukMvtU3 X-Received: by 2002:a63:4e13:0:b0:46f:c465:5848 with SMTP id c19-20020a634e13000000b0046fc4655848mr4363426pgb.148.1668232404834; Fri, 11 Nov 2022 21:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668232404; cv=none; d=google.com; s=arc-20160816; b=Xr8jzKnYetQLhaikHVyjEYEVB3E2I/2f3bnaaqdWlXTqI2Xt0gU8eeGBQ9lxt12fC3 BiyTZvq9+Ym3ypE5WwkoN5uN32MfaYu5OQFlm+B+sXiraiXUWcuneo+xFRIOO7IDtw+g 2IRo663p0iUR6/MEZNkSjvCcd/7j31ZHdLA0Q0MvHv8ABoTzpA8e58SIQCaJkgf7nWs6 lKe39fznapvIR2nA3MDPfRaNxnkOd47avwIzDdysqL8ZAfmqfOhzFRHDR7nyBJEJlJtl 30b24dE6ltA4xnOM5i3fO9Gn+4fbhNjzEFmHfyyu3uGc9eRwRJQeCWi3qslVp8wyG8sK m41w== 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:date:subject:cc:to:from:message-id :dkim-signature; bh=UKrCkq3xKMj8sSLZqZpNU4Q0Lx+VN8Ps1Ny3URH+YVY=; b=0D3pGDi+MtY4yO1b/S8uEenwh/HmoIkYGkRfoVTUQBoUdEYSBIDisfrJ3Pr9+CVpcu KDW61UckvDQKwHCCIgVnEFzdvBxPZWxJpAIGpzoIDizvycxPzBZQaDJbRW5wHfc28en5 b5CAyWDnqVhhyjBMlAY+DIctcCksOvo6XxOCm5/UFM9bJZ1tXl7Hd/79qghZBINiOdfk 5Bw3AR2MWmOg+3Z8FHSm38EsSlm3ZEGuRXNhBnXtxIlJfqx9SSc7yOKqMjcsPlC89L31 FtuyAxDcms25RkmNq7COF/yrxi6ivaY9FfcbvhBE20ndMOMp/zxz1wV4K5+nXJm2UYMd B86g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=QmE6AoM+; 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=foxmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pa10-20020a17090b264a00b001fdd01d3d1bsi4464569pjb.168.2022.11.11.21.52.59; Fri, 11 Nov 2022 21:53:24 -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=@foxmail.com header.s=s201512 header.b=QmE6AoM+; 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=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231480AbiKLFCd (ORCPT + 90 others); Sat, 12 Nov 2022 00:02:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiKLFCb (ORCPT ); Sat, 12 Nov 2022 00:02:31 -0500 Received: from out203-205-221-240.mail.qq.com (out203-205-221-240.mail.qq.com [203.205.221.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20E421EEDD; Fri, 11 Nov 2022 21:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1668229346; bh=UKrCkq3xKMj8sSLZqZpNU4Q0Lx+VN8Ps1Ny3URH+YVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QmE6AoM+jI44+Oi9YGeGF/G31TjtOxWtVxOKz3GCaCfSZg+40W10fxg+rqDj8CJLb z8NQHFOqwcGKR9AaybqOHkPClgoyKSgiGw9z7pMq2qF0os55MLgZMaRfGia9a1q4Y0 C3tolvT9EAgL33Hg2y5Ejh5fcPA32Gd/7jggYlj4= Received: from localhost.localdomain ([111.199.191.46]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 450F4C4; Sat, 12 Nov 2022 13:01:05 +0800 X-QQ-mid: xmsmtpt1668229265t93w5drhr Message-ID: X-QQ-XMAILINFO: NKv2G1wnhDBnrr4E/kVfuAaOl1xdaPmH2g5MNcAlnARbTJTbpo2cOTjBhWNPR5 uGpsVe1XUsORP3gpZQmITaJAeWOU6WToXQr8yE9Eojcu1DpdAdsk4lE9iwL04PEGNPaxPVol36N5 W0zrLApB5zjHdUMxGZ/+0skjluPgfcViwQtw+YRsmmUNnkjOJi2UAMPx7U+l2OmDha5M+BcjDqbn GqJsdbk0WDCIZpdggcJZboR4Rgp9CqT0qa0hFmPz7JxN8U1fpM6Vre5Hd37W16JgIjInFjEbcF+4 ru6MbpqBnGDcM47iWxssziI3GKPo+Lr3hLFt815RGapVRRYXCOWnWXWzJDZXBZrb2LQElxGaqaPq MTh/2hCcjZT1QCZNDUHTAzh+aNE6HaSZmVZVPDmLlgh3JKQpdxtTb6pS5SYJDGzRlEy09oU/peAx ZLMQggZFLf6NZo5srGxkIttroOSR0eBnoQLFQtGXhkrDdtWKacevNdRN0MO6shMziVNjXTxYDiMQ BD45EE5UaAxxv4gSr0bT8jY9UYwNUWDRqTYms5YnBsy04IU3kFZffsrCZM1BrX0czsfNLE1JYQYY k/Me8aVOjGwKsIeGD1f/YsauWxhGEKH6ooD69baH8cg3gCe/qNewUYKCpopvZPevBYXfEa+eZOCH uBlho+DLL7EeNRpf7WHrnngiVahhp6VQ2GS861E3gT+YQaEQOkPCRz/oplB33uvJBUYKiqMTigpz CgSvKsXYYHGamRV5UIFlZEAGQMD6FKDSYGUv6YVOQIv7vRtKQXW7w93+FNR6DC4iaLWe/XAZGbaE 0iqWMYfpvMtpPqJbygyqkMHkjQwooiTEhx39CgQrXK7p+HD9w34duXzRuka3IrEbEdeHrUyYZ2zo SH0G3NidKkhxaCFcGXEKYLn4mb4AgHUErt4nHzr6FwkYoDd+bJ84E2ktHfjiANIMPa2JWd3N+6oV +J7Ljiap2SQNvqbFfIPAOqYdOg2bxXQMpISlFq5pFZ2lrlZj405A== From: Rong Tao To: sj@kernel.org Cc: damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, rongtao@cestc.cn, rtoax@foxmail.com, shuah@kernel.org, yuanchu@google.com Subject: Re: Re: [PATCH] selftests/damon: Fix unnecessary compilation warnings Date: Sat, 12 Nov 2022 13:01:04 +0800 X-OQ-MSGID: <20221112050104.22783-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221111173855.108360-1-sj@kernel.org> References: <20221111173855.108360-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no 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, 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? Good day! Rong Tao