printk can't display %d number , but can display %u, %s, ....

From: xuhaoz
Date: Mon Sep 27 2004 - 21:24:02 EST



Hi:

Yesterday, I found a strangeous problem that printk in my OS can't print %d format number, but can print %u, %x ...

why?

let's see an example:

unsigned int memsize;

memsize=64;

printk("memsize unknown: setting to %dMB\n",memsize);

if I use %d to display, the result of memsize is -18446744073709551552MB

printk("memsize unknown: setting to %uMB\n",memsize);

if I use %u to display ,the result of memsize is 64MB

Would you please tell me what leads to this problem?



xuhaoz@xxxxxxxxxxxxx

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/