Attached patch OK for master branch? Will push soon if there are no objections.
From a74ce95293fc310557047fa5da6fb9d55e760f61 Mon Sep 17 00:00:00 2001 From: Jonathan Yong <10wa...@gmail.com> Date: Sun, 13 Apr 2025 02:41:36 +0000 Subject: [PATCH] Wbuiltin-declaration-mismatch-4.c: accept long long in warning for llp64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
llp64 targets like mingw-w64 will print: gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c:80:17: warning: ‘memset’ argument 3 promotes to ‘ptrdiff_t’ {aka ‘long long int’} where ‘long long unsigned int’ is expected in a call to built-in function declared without prototype [- Wbuiltin-declaration-mismatch] Change the regex pattern to accept it. Signed-off-by: Jonathan Yong <10wa...@gmail.com> gcc/testsuite/ChangeLog: * gcc.dg/Wbuiltin-declaration-mismatch-4.c: Make diagnostic accept long long. --- gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c index c48fe5fcf30..09aaaa665b4 100644 --- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c +++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c @@ -77,9 +77,9 @@ void test_integer_conversion_memset (void *d) /* Passing a ptrdiff_t where size_t is expected may not be unsafe but because GCC may emits suboptimal code for such calls warning for them helps improve efficiency. */ - memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?\(int\)?\(__int20\)?.} where .\(long \)?\(__int20 \)?unsigned\( int\)?. is expected" } */ + memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)*\(int\)?\(__int20\)?.} where .\(long \)*\(__int20 \)?unsigned\( int\)?. is expected" } */ - memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?\(__int20 \)?unsigned\( int\)?' is expected" } */ + memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)*\(__int20 \)?unsigned\( int\)?' is expected" } */ /* Verify that the same call as above but to the built-in doesn't trigger a warning. */ -- 2.49.0