splintchecker/splint

'hh' format modifier not recognised

Closed this issue · 2 comments

In Splint v3.1.2 on OpenBSD 6.2, analyzing code containing a format string using the 'hh' modifier results in the following error:

$ splint hhx.c
Splint 3.1.2 --- 02 Oct 2017

hhx.c: (in function main)
hhx.c:5:12: Unrecognized format code: %hhX\n
  Format code in a format string is not valid. (Use -formatcode to inhibit
  warning)

Finished checking --- 1 code warning

Here is the code that was analyzed:

#include <stdio.h>

int main(void) {
        unsigned char letter = 'a';
        printf("%hhX\n", letter);

        return 0;
}

This is fixed on the master branch of this repository.

Had a couple issues getting the build to work (I'll submit a PR with my fixes shortly), but once I did, the fix looked good.

Thanks!