CLANG reports an error with %b in printf(9)

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Tue, 1 Oct 2013 21:30:17 +0200
This is on HEAD -- while compiling the kernel with CLANG and slightly
higher warns level, i get errors of this kind (in multiple places):

/usr/home/luigi/FreeBSD/head/sys/cam/cam_xpt.c:1069:27: error: invalid conversion specifier
      'b' [-Werror,-Wformat-invalid-specifier]
                printf("%s%d: quirks=0x%b\n", periph->periph_name,
                                       ~^
/usr/home/luigi/FreeBSD/head/sys/cam/cam_xpt.c:1070:36: error: data argument not used by
      format string [-Werror,-Wformat-extra-args]
                    periph->unit_number, quirks, bit_string);

Does anyone know how hard it is to either disable the warning locally
(for a statement, function or file), or better to teach CLANG that
printf(9) uses two arguments for %b ?

cheers
luigi
Received on Tue Oct 01 2013 - 17:28:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:42 UTC