[U-Boot] [PATCH] nios2: change size_t to fix format warning for gcc 4.7.3

Thomas Chou thomas at wytron.com.tw
Tue Sep 3 04:38:35 CEST 2013


The gcc-4.7.3 in lastest nios2 toolchain generated lots of warning on
type mismatch. So change typedef of size_t to unsigned int, followed
those of arm and mips arch.

spi_flash.c: In function 'spi_flash_read_write':
spi_flash.c:42:3: warning: format '%zu' expects argument of type
  'size_t', but argument 2 has type 'long unsigned int' [-Wformat]

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
 arch/nios2/include/asm/posix_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/nios2/include/asm/posix_types.h b/arch/nios2/include/asm/posix_types.h
index 6733640..b4bf261 100644
--- a/arch/nios2/include/asm/posix_types.h
+++ b/arch/nios2/include/asm/posix_types.h
@@ -16,8 +16,8 @@ typedef int		__kernel_pid_t;
 typedef unsigned short	__kernel_ipc_pid_t;
 typedef unsigned short	__kernel_uid_t;
 typedef unsigned short	__kernel_gid_t;
-typedef unsigned long	__kernel_size_t;
-typedef long		__kernel_ssize_t;
+typedef unsigned int	__kernel_size_t;
+typedef int		__kernel_ssize_t;
 typedef int		__kernel_ptrdiff_t;
 typedef long		__kernel_time_t;
 typedef long		__kernel_suseconds_t;
-- 
1.8.3.1



More information about the U-Boot mailing list