[PATCH] cast current_wordsize to an int

Denys Vlasenko dvlasenk at redhat.com
Tue May 15 12:32:30 UTC 2012


On 04/28/2012 12:58 AM, Mike Frysinger wrote:
> On 64bit systems with a single personality, we see:
> count.c: In function 'call_summary':
> count.c:223:5: warning: format '%u' expects type 'unsigned int',
> 	but argument 3 has type 'long unsigned int'

long???

Ah, I see.

#ifndef PERSONALITY0_WORDSIZE
# define PERSONALITY0_WORDSIZE sizeof(long)
#endif
...
#else
# define set_personality(personality) ((void)0)
# define current_personality 0
# define current_wordsize    PERSONALITY0_WORDSIZE
#endif


This is how current_wordsize can be long. In other cases
it will be int. The correct fix is to use (int)(sizeof(long)),
ensuring that current_wordsize always has type "int".

I'll fix it in git...
-- 
vda




More information about the Strace-devel mailing list