DragonFly BSD
DragonFly users List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Easy c debugging question


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Mar 2005 16:10:35 -0800 (PST)

:On Tue, Mar 29, 2005 at 05:32:23PM +0300, Dennis Melentyev wrote:
:> walt wrote:
:> >printf("user=%16d\n", k->cp_user);
:> 
:> The hint:
:> 
:> Just use -Wformat or even -Wall, -pedantic and -Werror in gcc command 
:> line and _*READ*_ the warnings.
:[...]
:> 
:> So, you're trying to spoil the stack putting there 64bit values but 
:> extracting the 32bit ones...
:
:Right. You should include inttypes.h and use e.g. PRId64 to format it.
:
:Joerg

    Umm.  Try the initialized pointer being passed to 
    kinfo_get_sched_cputime().

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]