]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Wbuiltin-declaration-mismatch-4.c: accept long long in warning for llp64
authorJonathan Yong <10walls@gmail.com>
Sun, 13 Apr 2025 02:41:36 +0000 (02:41 +0000)
committerJonathan Yong <10walls@gmail.com>
Tue, 15 Apr 2025 11:38:40 +0000 (11:38 +0000)
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 <10walls@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

index c48fe5fcf3009225b41279a661ca44dd5fd4a6c0..09aaaa665b49ed3354b1e877dc6ad1cc1125a346 100644 (file)
@@ -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.  */