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: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Tue, 29 Mar 2005 19:41:32 +0200
Mail-followup-to: users@crater.dragonflybsd.org

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



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