This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Question about warning in gdb/remote.c
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 30 Jun 2003 11:06:48 -0400
- Subject: Re: Question about warning in gdb/remote.c
- References: <hon0g02eg5.fsf@byrd.suse.de>
compiling gdb I get this warning:
/cvs/src-gdb/src/gdb/remote.c:3290: warning: too many arguments for format
What is supposed to happen here? The line is:
error ("Remote register badly formatted: %s\nhere:", buf, p);
gcc -Werror -Wformat is ment to not build (but the gcc I used did ... :-?).
Should a %s added for p at the end - or should p get removed?
It should print `p'. I checked in the attached.
thanks!
Andrew
2003-06-30 Andrew Cagney <cagney@redhat.com>
* remote.c (remote_async_wait): Fix -Wformat problem.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.108
diff -u -r1.108 remote.c
--- remote.c 29 Jun 2003 21:17:22 -0000 1.108
+++ remote.c 30 Jun 2003 15:02:25 -0000
@@ -3287,7 +3287,8 @@
}
if (*p++ != ';')
- error ("Remote register badly formatted: %s\nhere:", buf, p);
+ error ("Remote register badly formatted: %s\nhere: %s",
+ buf, p);
}
}
/* fall through */