warning spew from cddl libnvpair.c

Sean Bruno sean_bruno at yahoo.com
Fri Oct 25 03:52:39 UTC 2013


libnvpair.c has some macros and preprocessor directives that make
clang's -Wformat-security very unhappy.

/home/sbruno/bsd/head/cddl/lib/libnvpair/../../../cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:245:1: warning: format string is not a string literal (po
tentially insecure) [-Wformat-security]
NVLIST_ARRPRTFUNC(byte_array, uchar_t, uchar_t, "0x%2.2x")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sbruno/bsd/head/cddl/lib/libnvpair/../../../cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:238:23: note: expanded from macro 'NVLIST_ARRPRTFUNC'
                        (void) fprintf(fp, pctl->nvprt_btwnarrfmt); \


I don't see a real graceful way out of this.  Also, this is totally
"legit" C, so I don't see any reason to generate these warnings.  Can
someone educate me on either:
  1.  fixing these warnings the right way
  2.  how to disable the warning flags/makefile magic

sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20131024/faf904af/attachment.sig>


More information about the freebsd-hackers mailing list