Attached patch OK for master branch?
From 768ed67f3d3536305000cc55ed2c4ff481589954 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <[email protected]>
Date: Tue, 17 Feb 2026 02:08:55 +0000
Subject: [PATCH] gcc.dg/plugin: fix spurious llp64 warnings

Fixes compile tests with mingw-w64.

gcc/testsuite/ChangeLog:

	* gcc.dg/plugin/taint-pr112850-precise.c:
	(__kernel_ulong_t): Change unsigned long to __UINTPTR_TYPE__.
	(__kernel_size_t): Change __kernel_ulong_t to __kernel_size_t.
	(copy_from_user): Change unsigned long n to size_t n.
	(snd_rawmidi_ioctl): Change unsigned long arg to uintptr_t arg.
	* gcc.dg/plugin/taint-pr112850-too-complex.c: Ditto.
	* gcc.dg/plugin/taint-pr112850-unsanitized.c: Ditto.
	* gcc.dg/plugin/taint-pr112850.c: Ditto.

Signed-off-by: Jonathan Yong <[email protected]>
---
 gcc/testsuite/gcc.dg/plugin/taint-pr112850-precise.c     | 8 ++++----
 gcc/testsuite/gcc.dg/plugin/taint-pr112850-too-complex.c | 8 ++++----
 gcc/testsuite/gcc.dg/plugin/taint-pr112850-unsanitized.c | 8 ++++----
 gcc/testsuite/gcc.dg/plugin/taint-pr112850.c             | 8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-precise.c b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-precise.c
index 558f0fb1a8a..30b25db7ec7 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-precise.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-precise.c
@@ -7,12 +7,12 @@
 /* { dg-options "-fanalyzer -O2 -Wanalyzer-symbol-too-complex --param=analyzer-max-svalue-depth=13" } */
 /* { dg-require-effective-target analyzer } */
 
-typedef unsigned long __kernel_ulong_t;
-typedef __kernel_ulong_t __kernel_size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+typedef __SIZE_TYPE__ __kernel_size_t;
 typedef __kernel_size_t size_t;
 typedef unsigned int gfp_t;
 
-extern unsigned long copy_from_user(void* to, const void* from, unsigned long n);
+extern unsigned long copy_from_user(void* to, const void* from, size_t n);
 
 extern
 __attribute__((__alloc_size__(1)))
@@ -40,7 +40,7 @@ resize_runtime_buffer(struct snd_rawmidi_params* params)
 }
 
 long
-snd_rawmidi_ioctl(unsigned long arg)
+snd_rawmidi_ioctl(uintptr_t arg)
 {
   void* argp = (void*)arg;
   struct snd_rawmidi_params params;
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-too-complex.c b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-too-complex.c
index 2a4ee8197c3..29efab0c9bf 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-too-complex.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-too-complex.c
@@ -8,12 +8,12 @@
 /* { dg-options "-fanalyzer -O2 -Wanalyzer-symbol-too-complex --param=analyzer-max-svalue-depth=12" } */
 /* { dg-require-effective-target analyzer } */
 
-typedef unsigned long __kernel_ulong_t;
-typedef __kernel_ulong_t __kernel_size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+typedef __SIZE_TYPE__ __kernel_size_t;
 typedef __kernel_size_t size_t;
 typedef unsigned int gfp_t;
 
-extern unsigned long copy_from_user(void* to, const void* from, unsigned long n);
+extern unsigned long copy_from_user(void* to, const void* from, size_t n);
 
 extern
 __attribute__((__alloc_size__(1)))
@@ -41,7 +41,7 @@ resize_runtime_buffer(struct snd_rawmidi_params* params)
 }
 
 long
-snd_rawmidi_ioctl(unsigned long arg)
+snd_rawmidi_ioctl(uintptr_t arg)
 {
   void* argp = (void*)arg;
   struct snd_rawmidi_params params;
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-unsanitized.c b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-unsanitized.c
index e46fcb6c8a1..cdfc0cf63b6 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-pr112850-unsanitized.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-pr112850-unsanitized.c
@@ -7,12 +7,12 @@
 /* { dg-options "-fanalyzer -O2 -Wanalyzer-too-complex" } */
 /* { dg-require-effective-target analyzer } */
 
-typedef unsigned long __kernel_ulong_t;
-typedef __kernel_ulong_t __kernel_size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+typedef __SIZE_TYPE__ __kernel_size_t;
 typedef __kernel_size_t size_t;
 typedef unsigned int gfp_t;
 
-extern unsigned long copy_from_user(void* to, const void* from, unsigned long n);
+extern unsigned long copy_from_user(void* to, const void* from, size_t n);
 
 extern
 __attribute__((__alloc_size__(1)))
@@ -40,7 +40,7 @@ resize_runtime_buffer(struct snd_rawmidi_params* params)
 }
 
 long
-snd_rawmidi_ioctl(unsigned long arg)
+snd_rawmidi_ioctl(uintptr_t arg)
 {
   void* argp = (void*)arg;
   struct snd_rawmidi_params params;
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-pr112850.c b/gcc/testsuite/gcc.dg/plugin/taint-pr112850.c
index 6fa1d0f9bd4..f427b3f8620 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-pr112850.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-pr112850.c
@@ -4,12 +4,12 @@
 /* { dg-options "-fanalyzer -O2 -Wanalyzer-symbol-too-complex" } */
 /* { dg-require-effective-target analyzer } */
 
-typedef unsigned long __kernel_ulong_t;
-typedef __kernel_ulong_t __kernel_size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+typedef __SIZE_TYPE__ __kernel_size_t;
 typedef __kernel_size_t size_t;
 typedef unsigned int gfp_t;
 
-extern unsigned long copy_from_user(void* to, const void* from, unsigned long n);
+extern unsigned long copy_from_user(void* to, const void* from, size_t n);
 
 extern
 __attribute__((__alloc_size__(1)))
@@ -37,7 +37,7 @@ resize_runtime_buffer(struct snd_rawmidi_params* params)
 }
 
 long
-snd_rawmidi_ioctl(unsigned long arg)
+snd_rawmidi_ioctl(uintptr_t arg)
 {
   void* argp = (void*)arg;
   struct snd_rawmidi_params params;
-- 
2.53.0

Reply via email to