Skip to contentSkip to conversation

arc: Fix printf size_t format related warnings (again...)

PATCH New Vasili Galka 2 participants 2 messages Aug 26, 2014 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arc: Fix printf size_t format related warnings (again...)

The basic idea: Define size_t using the __SIZE_TYPE__ compiler-defined type.

For detailed explanation see similar patch for the nios2 arch:
http://patchwork.ozlabs.org/patch/379938/

Cc Alexey Brodkin <[email protected]>
---
 arch/arc/include/asm/posix_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arc/include/asm/posix_types.h +4 -0
index 20415f0..51347a4 100644
@@ -16,7 +16,11 @@ typedef int			__kernel_pid_t;
 typedef unsigned short		__kernel_ipc_pid_t;
 typedef unsigned short		__kernel_uid_t;
 typedef unsigned short		__kernel_gid_t;
+#ifdef __GNUC__
+typedef __SIZE_TYPE__		__kernel_size_t;
+#else
 typedef unsigned int		__kernel_size_t;
+#endif
 typedef int			__kernel_ssize_t;
 typedef int			__kernel_ptrdiff_t;
 typedef long			__kernel_time_t;
Signature · 1 line
1.7.9
#1 lore raw

PATCH 1/1 arc: Fix printf size_t format related warnings (again...)

Hi Vasili,

Quoted 18 lines · Vasili Galka

The basic idea: Define size_t using the __SIZE_TYPE__ compiler-defined type.

For detailed explanation see similar patch for the nios2 arch:
http://patchwork.ozlabs.org/patch/379938/

Cc Alexey Brodkin <[email protected]>
---
 arch/arc/include/asm/posix_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arc/include/asm/posix_types.h +0 -0
index 20415f0..51347a4 100644
@@ -16,7 +16,11 @@ typedef int			__kernel_pid_t;
 typedef unsigned short		__kernel_ipc_pid_t;

arch/arc/include/asm/posix_types.h typedef int __kernel_pid_t; · line 26

Quoted 10 lines
arch/arc/include/asm/posix_types.h +4 -0
 typedef unsigned short		__kernel_uid_t;
 typedef unsigned short		__kernel_gid_t;
+#ifdef __GNUC__
+typedef __SIZE_TYPE__		__kernel_size_t;
+#else
 typedef unsigned int		__kernel_size_t;
+#endif
 typedef int			__kernel_ssize_t;
 typedef int			__kernel_ptrdiff_t;
 typedef long			__kernel_time_t;

Applied,

Thanks!