[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 4/5] kconfig: disable non-literal format string warnings
On Wed, Jun 26, 2019 at 08:45:27AM -0600, Jan Beulich wrote: > >>> On 26.06.19 at 15:55, <roger.pau@xxxxxxxxxx> wrote: > > Kconfig makes heavy use of non-literals as format strings, disable > > compiler warnings since this is expected usage. > > I've never seen any with any version of gcc - are there more > aspects to be mentioned here? Oh, I've always seen them with clang. Not sure why gcc doesn't show such warnings. clang -Wp,-MD,tools/kconfig/.conf.o.d -DCURSES_LOC="<ncurses.h>" -DLOCALE -DKBUILD_NO_NLS -c -o tools/kconfig/conf.o tools/kconfig/conf.c tools/kconfig/conf.c:77:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security] printf(_("aborted!\n\n")); ^~~~~~~~~~~~~~~~~ tools/kconfig/lkc.h:34:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ tools/kconfig/conf.c:77:10: note: treat the string as an argument to avoid this printf(_("aborted!\n\n")); ^ "%s", tools/kconfig/lkc.h:34:17: note: expanded from macro '_' #define _(text) gettext(text) ^ tools/kconfig/conf.c:78:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security] printf(_("Console input/output is redirected. ")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tools/kconfig/lkc.h:34:17: note: expanded from macro '_' #define _(text) gettext(text) ^~~~~~~~~~~~~ tools/kconfig/conf.c:78:10: note: treat the string as an argument to avoid this printf(_("Console input/output is redirected. ")); ^ "%s", tools/kconfig/lkc.h:34:17: note: expanded from macro '_' #define _(text) gettext(text) ^ [...] > > > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> > > --- > > Cc: Doug Goldstein <cardoe@xxxxxxxxxx> > > --- > > xen/tools/kconfig/Makefile.kconfig | 5 +++++ > > 1 file changed, 5 insertions(+) > > You Cc list looks to be too short for this change. That's what get_maintainer.pl has given me. Maybe the syntax in MAINTAINERS is not correct, or get_maintainer.pl needs adjustments. > > > --- a/xen/tools/kconfig/Makefile.kconfig > > +++ b/xen/tools/kconfig/Makefile.kconfig > > @@ -43,6 +43,11 @@ FORCE: > > # Sets toolchain binaries to use > > include $(XEN_ROOT)/config/$(shell uname -s).mk > > > > +# Disable format warnings, kconfig makes heavy use of non-literal format > > +# strings. > > +HOSTCFLAGS += -Wno-format > > +HOSTCXXFLAGS += -Wno-format > > But this disables far more warnings than ones for non-literal format > strings, at least afaict. Sorry, it should be -Wno-format-security. I think I dropped the -security part while copying. Thanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |