[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


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 26 Jun 2019 17:20:36 +0200
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
  • Delivery-date: Wed, 26 Jun 2019 15:20:46 +0000
  • Ironport-sdr: OxXN5w05iQdKVu+abTqJvvYjxwbh/ocvgKRkcYlP9rVqNx1jPeIjdvIx55dJ1DH/PcYgOUsaTn peEw8UcjKN3jFUHFvHTnAjxwQ0PKW3qqqtD/SNNtlsI0VbcH20CDt0mD5StVuWQDKaUPe0uGzU 5uHEqnRQe44qbHUbrMoIIfW+x9HcEQGxRNPNBHOcf8XG6Xe8NZxOS1qJI7dxNkveDAk15Qe3f8 qKBlTuITPo6lbb3o5Cu3/tUj1C5o+GsJh0WZaNIRZtI4im3zyPjzkRf3L+MekNwzv6SZftfMDI U+E=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.