[U-Boot-Users] printf question

Wells, Charles Charles.Wells at NielsenMedia.com
Wed Mar 24 14:33:53 CET 2004


> unsigned char x = 0xC2;
>
> printf("this is the problem %02X\n", x);
>
> result is:
>
> this is the problem FFFFFFFC2

This is a compiler issue.  You told the compiler that x was of type unsigned
char and it ignored you.  When x was converted to an argument, the compiler
treated it as signed.  Once x gets sign extended, there's no way for the
printf function to know.

Regards,
Charlie




More information about the U-Boot mailing list