[patch, rfc] Don't try to build printcmd.c and valprint.c with -Wformat-nonliteral
Andrew Cagney
ac131313@redhat.com
Sat Aug 16 17:49:00 GMT 2003
> Hello,
>
> On these two I'm, for the moment, giving up (they are the only ones left).
>
> printcmd.c: This is passing user input to printf as the format string. I think it needs to instead fully parse that format specifier.
>
> valprint.c: This is running into local_hex_format et.al. I think that needs an overhaul regardess - written in a way that is more host/target independant.
>
> Comments, thoughts, anyone want to overhaul the language output format code? The other option is to wind back the -Werror list, sigh.
I've checked this in. Bug reports to follow.
Andrew
> 2003-08-10 Andrew Cagney <cagney@redhat.com>
>
> * Makefile.in (printcmd.o, valprint.o): Do not try to build with
> -Werror. -Wformat-nonliteral problems.
>
> Index: Makefile.in
> ===================================================================
> RCS file: /cvs/src/src/gdb/Makefile.in,v
> retrieving revision 1.424
> diff -u -r1.424 Makefile.in
> --- Makefile.in 8 Aug 2003 17:30:35 -0000 1.424
> +++ Makefile.in 10 Aug 2003 20:06:32 -0000
> @@ -1321,6 +1321,12 @@
> $(CC) -c $(INTERNAL_CFLAGS) $(TARGET_SYSTEM_ROOT_DEFINE) \
> -DBINDIR=\"$(bindir)\" $(srcdir)/main.c
>
> +# FIXME: cagney/2003-08-10: Do not try to build "printcmd.c" with
> +# -Wformat-nonliteral. It needs to be overhauled so that it doesn't
> +# pass input strings to host printf function.
> +printcmd.o: $(srcdir)/printcmd.c
> + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/printcmd.c
> +
> # FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
> # match output format strings.
> procfs.o: $(srcdir)/procfs.c
> @@ -1337,6 +1343,12 @@
> $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
> $(GDBTK_CFLAGS) \
> $(srcdir)/v850ice.c
> +
> +# FIXME: cagney/2003-08-10: Do not try to build "valprint.c" with
> +# -Wformat-nonliteral. It relies on local_hex_format et.al. and
> +# that's a mess. It needs a serious overhaul.
> +valprint.o: $(srcdir)/valprint.c
> + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/valprint.c
>
> # FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
> # declared -Wimplicit fails. It should be using the GDBARCH framework.
More information about the Gdb-patches
mailing list