public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t 4/6] igt/drm_read: Fix build warning
Date: Fri, 19 Nov 2021 12:59:43 +0000	[thread overview]
Message-ID: <20211119125945.55056-4-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20211119125945.55056-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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 <tvrtko.ursulin@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 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


  parent reply	other threads:[~2021-11-19 13:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 12:59 [Intel-gfx] [PATCH i-g-t 1/6] tests/api_intel_allocator: Fix build warning Tvrtko Ursulin
2021-11-19 12:59 ` [Intel-gfx] [PATCH i-g-t 2/6] igt/drm_read: " Tvrtko Ursulin
2021-11-19 12:59 ` [Intel-gfx] [PATCH i-g-t 3/6] igt/core: " Tvrtko Ursulin
2021-11-19 13:53   ` Petri Latvala
2021-11-19 15:34     ` Tvrtko Ursulin
2021-11-19 15:41       ` Petri Latvala
2021-11-19 15:54         ` [Intel-gfx] [igt-dev] " Petri Latvala
2021-11-22  9:03           ` Tvrtko Ursulin
2021-11-19 12:59 ` Tvrtko Ursulin [this message]
2021-11-19 12:59 ` [Intel-gfx] [PATCH i-g-t 5/6] intel_gpu_top: Remove clients support Tvrtko Ursulin
2021-11-26 13:07   ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
2021-11-26 14:01     ` Petri Latvala
2021-11-26 14:16       ` Tvrtko Ursulin
2021-11-19 12:59 ` [Intel-gfx] [PATCH i-g-t 6/6] intel_gpu_top: Add a sanity check discovered busy metric is per engine Tvrtko Ursulin
2021-12-01  2:20   ` Rogozhkin, Dmitry V
2021-12-01 10:06     ` Tvrtko Ursulin
2021-11-22  5:58 ` [Intel-gfx] [PATCH i-g-t 1/6] tests/api_intel_allocator: Fix build warning Zbigniew Kempczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119125945.55056-4-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox