From the printf(3) man page:
The length modifier
Here, "integer conversion" stands for d, i, o, u, x, or X conversion.
hh A following integer conversion corresponds to a signed char or unsigned char argument,
or a following n conversion corresponds to a pointer to a signed char argument.
$ cat foo.c
#include <stdio.h>
int main()
{
int a = 3;
printf("%hhx\n", a);
return 0;
}
$ splint foo.c
Splint 3.1.2 --- 23 Aug 2008
foo.c: (in function main)
foo.c:6:17: Unrecognized format code: %02hhx\n
Format code in a format string is not valid. (Use -formatcode to inhibit
warning)
Finished checking --- 1 code warning
Bug based on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510821
test-case
This is fixed in CVS. The warning is now,
foo.c: (in function main)
foo.c:6:22: Format argument 1 to printf (%hhx) expects unsigned int gets int: a
To ignore signs in type comparisons use +ignoresigns
foo.c:6:16: Corresponding format code
Changing 'int a =3' to 'unsigned int a =3' gives no warnings with default arguments.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).