On Sat, May 14, 2011 at 04:31:10PM -0700, Jeremy Huddleston wrote:
>
> inpututils.c:577:25: warning: conversion specifies type 'unsigned short' but
> the argument has type 'unsigned char' [-Wformat,Format String Issue]
> ErrorF("%02hx ", *data);
> ~~~~^ ~~~~~
> %02hhx
> 1 warning generated.
While the fix isn't wrong, it's odd that clang complains about this.
Since ErrorF is a varargs function, *data will be promoted to int, so
while printing it with %02hx is a bit odd, it is perfectly legal C.
Because of the integer promotion, I would actually simply use %02x
here, since I think the h and hh length modifiers are a bit obscure.
Would clang complain about using %02x as well?
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel