public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings
@ 2024-02-02 23:55 Jonathan Yong
  2024-02-11  1:05 ` Jonathan Yong
  2024-02-14 13:55 ` David Malcolm
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Yong @ 2024-02-02 23:55 UTC (permalink / raw)
  To: Gcc Patch List

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

Attached patch OK? Fixes the following warnings:
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__))
       | ^~~~~~

Copied for review convenience:
diff --git a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
index 5684d1b02d4..dadd27eaf41 100644
--- a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
+++ b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
@@ -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;

[-- Attachment #2: 0001-coreutils-sum-pr108666.c-fix-spurious-LLP64-warnings.patch --]
[-- Type: text/x-patch, Size: 1764 bytes --]

From 54731e86e4bdce03ef4a722860ea8cee931ec127 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Fri, 2 Feb 2024 23:47:47 +0000
Subject: [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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:

	* 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
index 5684d1b02d4..dadd27eaf41 100644
--- a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
+++ b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
@@ -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;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings
  2024-02-02 23:55 [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings Jonathan Yong
@ 2024-02-11  1:05 ` Jonathan Yong
  2024-02-14 13:55 ` David Malcolm
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2024-02-11  1:05 UTC (permalink / raw)
  To: Gcc Patch List

On 2/2/24 23:55, Jonathan Yong wrote:
> Attached patch OK? Fixes the following warnings:
> 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__))
>        | ^~~~~~
> 
> Copied for review convenience:
> diff --git 
> a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c 
> b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
> index 5684d1b02d4..dadd27eaf41 100644
> --- a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
> +++ b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
> @@ -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;

Ping?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings
  2024-02-02 23:55 [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings Jonathan Yong
  2024-02-11  1:05 ` Jonathan Yong
@ 2024-02-14 13:55 ` David Malcolm
  2024-02-14 15:59   ` Jonathan Yong
  1 sibling, 1 reply; 4+ messages in thread
From: David Malcolm @ 2024-02-14 13:55 UTC (permalink / raw)
  To: Jonathan Yong, Gcc Patch List

On Fri, 2024-02-02 at 23:55 +0000, Jonathan Yong wrote:
> Attached patch OK? Fixes the following warnings:

Thanks; looks good to me.

Dave

> 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__))
>        | ^~~~~~
> 
> Copied for review convenience:
> diff --git a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-
> pr108666.c b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-
> pr108666.c
> index 5684d1b02d4..dadd27eaf41 100644
> --- a/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
> +++ b/gcc/testsuite/c-c++-common/analyzer/coreutils-sum-pr108666.c
> @@ -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;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings
  2024-02-14 13:55 ` David Malcolm
@ 2024-02-14 15:59   ` Jonathan Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2024-02-14 15:59 UTC (permalink / raw)
  To: David Malcolm, Gcc Patch List

On 2/14/24 13:55, David Malcolm wrote:
> On Fri, 2024-02-02 at 23:55 +0000, Jonathan Yong wrote:
>> Attached patch OK? Fixes the following warnings:
> 
> Thanks; looks good to me.
> 
> Dave
> 
Thanks, pushed to master branch.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-14 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 23:55 [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings Jonathan Yong
2024-02-11  1:05 ` Jonathan Yong
2024-02-14 13:55 ` David Malcolm
2024-02-14 15:59   ` Jonathan Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).