[U-Boot-Users] [PATCH] cmd_bdinfo: Fix printf() format warning

Wolfgang Denk wd at denx.de
Wed Jul 30 12:19:12 CEST 2008


In message <1217406953-11089-1-git-send-email-haavard.skinnemoen at atmel.com> you wrote:
> Fix the following warning on avr32 and, from the looks of it, all other
> architectures except arm, blackfin and mips.
> 
> cmd_bdinfo.c: In function 'do_bdinfo':
> cmd_bdinfo.c:367: warning: format '%d' expects type 'int', but argument
> 2 has type 'long unsigned int'
> 
> In order to not introduce new warnings on the aforementioned three
> architectures as well as i386, I added a cast to unsigned long. This
> should be safe even if bi_baudrate is declared as 'int' (assuming
> there's no such thing as negative baud rates.)

Instead of the cast, should we not rather fix ARM, BF and MIPS to use
ulong like anybody else?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
We Klingons believe as you do -- the sick should die. Only the strong
should live.
	-- Kras, "Friday's Child", stardate 3497.2




More information about the U-Boot mailing list