diff mbox

libc: Declare size_t as unsigned long

Message ID 1499307939-17547-1-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth July 6, 2017, 2:25 a.m. UTC
If size_t is only "int", memset() and friends are limited
to 4 GB. And ssize_t is already declared as "long", so it
is somewhat inconsequent to define size_t as "int" only.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/libc/include/stddef.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Alexey Kardashevskiy July 7, 2017, 6:45 a.m. UTC | #1
On 06/07/17 12:25, Thomas Huth wrote:
> If size_t is only "int", memset() and friends are limited
> to 4 GB. And ssize_t is already declared as "long", so it
> is somewhat inconsequent to define size_t as "int" only.
> 

Thanks, applied.

> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  lib/libc/include/stddef.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/libc/include/stddef.h b/lib/libc/include/stddef.h
> index ba2d960..e240106 100644
> --- a/lib/libc/include/stddef.h
> +++ b/lib/libc/include/stddef.h
> @@ -16,8 +16,7 @@
>  
>  #define NULL ((void *)0)
>  
> -
> -typedef unsigned int size_t;
> +typedef unsigned long size_t;
>  
>  
>  #endif
>
diff mbox

Patch

diff --git a/lib/libc/include/stddef.h b/lib/libc/include/stddef.h
index ba2d960..e240106 100644
--- a/lib/libc/include/stddef.h
+++ b/lib/libc/include/stddef.h
@@ -16,8 +16,7 @@ 
 
 #define NULL ((void *)0)
 
-
-typedef unsigned int size_t;
+typedef unsigned long size_t;
 
 
 #endif