lkml.org 
[lkml]   [2004]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectprintk can't display %d number , but can display %u, %s, ....

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@neonetech.com

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

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.037 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site