This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about warning in gdb/remote.c


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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]