]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coreutils-sum-pr108666.c: fix spurious LLP64 warnings
authorJonathan Yong <10walls@gmail.com>
Fri, 2 Feb 2024 23:47:47 +0000 (23:47 +0000)
committerJonathan Yong <10walls@gmail.com>
Wed, 14 Feb 2024 15:56:42 +0000 (15:56 +0000)
Fixes the following warnings on x86_64-w64-mingw32:
coreutils-sum-pr108666.c:17:1: warning: conflicting types for built-in function ‘memcpy’; expected ‘void *(void *, const void *, long long unsigned int)’ [-Wbuiltin-declaration-mismatch]
   17 | memcpy(void* __restrict __dest, const void* __restrict __src, size_t __n)
      | ^~~~~~

coreutils-sum-pr108666.c:25:1: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long long unsigned int)’ [-Wbuiltin-declaration-mismatch]
   25 | malloc(size_t __size) __attribute__((__nothrow__, __leaf__))
      | ^~~~~~

gcc/testsuite:

* c-c++-common/analyzer/coreutils-sum-pr108666.c: Use
__SIZE_TYPE__ instead of long unsigned int for size_t
definition.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c

index 5684d1b02d454fe0a05b2c004dd20a1411f00763..dadd27eaf4100f0b8d82ddc3adfc51ff4fe65c77 100644 (file)
@@ -1,6 +1,6 @@
 /* Reduced from coreutils's sum.c: bsd_sum_stream */
 
-typedef long unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
 typedef unsigned char __uint8_t;
 typedef unsigned long int __uintmax_t;
 typedef struct _IO_FILE FILE;