[U-Boot-Users] printf question
Wolfgang Denk
wd at denx.de
Wed Mar 24 18:55:20 CET 2004
In message <DCEAAC0833DD314AB0B58112AD99B93B06DA9D at ismail.innsys.innovsys.com> you wrote:
> This usually works even on cranky compilers:
>
> unsigned char x = 0xC2;
> printf("this is the problem %02X\n", (unsigned int)x);
But we agree that the conversion "unsigned char" ==> "unsigned int"
must result in exactly the same result, no matter if done implicitely
or by explicit cast?
If this doesn't work it means that the toolchain is broken and/or
misconfigured. Maybe there is no valid prototype for printf() active,
etc., but this should be visible when compiling with warnings turned
on.
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
God runs electromagnetics by wave theory on Monday, Wednesday, and
Friday, and the Devil runs them by quantum theory on Tuesday, Thurs-
day, and Saturday. -- William Bragg
More information about the U-Boot
mailing list