This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Compile valprint.c with -Werror
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 12 Sep 2004 12:12:05 -0400
- Subject: [commit] Compile valprint.c with -Werror
Thanks to paulH's recent commits, this becomes possible.
(printcmd.c is still a bit of a mess)
I've built this file with GCC 2.9x and 3.4x.
Committed,
Andrew
2004-09-12 Andrew Cagney <cagney@gnu.org>
* valprint.c (print_longest): Use fputs_filtered. Make "val"
const.
* Makefile.in (valprint.o): Delete explict rule.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.617
diff -p -u -r1.617 Makefile.in
--- Makefile.in 12 Sep 2004 13:04:37 -0000 1.617
+++ Makefile.in 12 Sep 2004 16:11:54 -0000
@@ -1465,12 +1465,6 @@ v850ice.o: $(srcdir)/v850ice.c
$(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
-
# Message files. Based on code in gcc/Makefile.in.
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.34
diff -p -u -r1.34 valprint.c
--- valprint.c 11 Sep 2004 10:24:52 -0000 1.34
+++ valprint.c 12 Sep 2004 16:11:55 -0000
@@ -230,7 +230,8 @@ void
print_longest (struct ui_file *stream, int format, int use_c_format,
LONGEST val_long)
{
- char *val;
+ const char *val;
+
switch (format)
{
case 'd':
@@ -253,8 +254,7 @@ print_longest (struct ui_file *stream, i
default:
internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
-
- fprintf_filtered (stream, val);
+ fputs_filtered (val, stream);
}
/* This used to be a macro, but I don't think it is called often enough