[U-Boot] cmd_sf warning on size_t

Andreas Bießmann andreas.devel at googlemail.com
Wed Dec 14 10:34:07 CET 2011


Dear Thomas Chou,

On 14.12.2011 07:36, Thomas Chou wrote:
> Hi Mike,
> 
> I got this warning on cmd_sf.c,
> 
> cmd_sf.c: In function `spi_flash_update_block':
> cmd_sf.c:130: warning: unsigned int format, size_t arg (arg 4)
> cmd_sf.c:135: warning: unsigned int format, size_t arg (arg 3)

I tumble over this these days too.

> It was related to our arch/avr32|blackfin|nios2/asm/posix_types.h
> typedef unsigned long __kernel_size_t;
> 
> While most other 32 bits archs use unsigned int, we three use unsigned
> long.
> 
> It is said in linux-2.6/include/asm-generic/posix_types.h
> /*
>  * Most 32 bit architectures use "unsigned int" size_t,
>  * and all 64 bit architectures use "unsigned long" size_t.
>  */
> 
> Shall we fix the cmd_sf.c, or shall I change size_t to unsigned int as
> other 32 bits archs do?

I tend to fix the cmd_sf.c and arch/avr32/cpu/at32ap700x/mmu.c
->
mmu.c:25: warning: format '%08x' expects type 'unsigned int', but
argument 2 has type 'uintptr_t'

I have already a patch, and would send it.

best regards

Andreas Bießmann


More information about the U-Boot mailing list