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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD0ADC433EF for ; Fri, 19 Nov 2021 13:00:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF5E06120E for ; Fri, 19 Nov 2021 13:00:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF5E06120E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EE5D6F569; Fri, 19 Nov 2021 13:00:19 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E9D86F565; Fri, 19 Nov 2021 13:00:13 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10172"; a="295222738" X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="295222738" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2021 05:00:12 -0800 X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="455769621" Received: from egedeon-mobl2.amr.corp.intel.com (HELO tursulin-mobl2.home) ([10.209.179.224]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2021 05:00:11 -0800 From: Tvrtko Ursulin To: igt-dev@lists.freedesktop.org Date: Fri, 19 Nov 2021 12:59:43 +0000 Message-Id: <20211119125945.55056-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211119125945.55056-1-tvrtko.ursulin@linux.intel.com> References: <20211119125945.55056-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Intel-gfx] [PATCH i-g-t 4/6] igt/drm_read: Fix build warning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Tvrtko Ursulin In function ‘read’, inlined from ‘test_invalid_buffer’ at ../../home/tursulin/wc/intel-gpu-tools/tests/drm_read.c:113:2, inlined from ‘__igt_unique____real_main258’ at ../../home/tursulin/wc/intel-gpu-tools/tests/drm_read.c:297:3: /usr/include/x86_64-linux-gnu/bits/unistd.h:47:10: warning: ‘__read_alias’ writing 4096 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] 47 | return __read_alias (__fd, __buf, __nbytes); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Tvrtko Ursulin Cc: Petri Latvala --- tests/drm_read.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/drm_read.c b/tests/drm_read.c index 4a966a23b550..d422220d3c4a 100644 --- a/tests/drm_read.c +++ b/tests/drm_read.c @@ -289,8 +289,16 @@ igt_main igt_require(kmstest_get_vblank(fd, pipe, 0)); } +/* + * Has to be here and not in (or around) test_invalid_buffer() to work around + * a gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98512. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Wstringop-overflow=" igt_subtest("invalid-buffer") test_invalid_buffer(fd); +#pragma GCC diagnostic pop igt_subtest("fault-buffer") test_fault_buffer(fd, pipe); -- 2.32.0