This is the mail archive of the gdb-patches@sourceware.org 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]

FYI: fix for PR 7196


I'm checking this in.

I happened across PR 7196, concerning bad casts to catch_errors_ftype.
I looked, and there was just a single such cast in the tree.

Tested by rebuilding on x86-64 F15.

Tom

2011-11-18  Tom Tromey  <tromey@redhat.com>

	PR build/7196:
	* remote.c (putpkt_for_catch_errors): New function.
	(remote_kill): Use it.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.469
diff -u -r1.469 remote.c
--- remote.c	14 Nov 2011 20:07:20 -0000	1.469
+++ remote.c	18 Nov 2011 15:36:59 -0000
@@ -7369,12 +7369,20 @@
 }
 
 
+/* A helper function that just calls putpkt; for type correctness.  */
+
+static int
+putpkt_for_catch_errors (void *arg)
+{
+  return putpkt (arg);
+}
+
 static void
 remote_kill (struct target_ops *ops)
 {
   /* Use catch_errors so the user can quit from gdb even when we
      aren't on speaking terms with the remote system.  */
-  catch_errors ((catch_errors_ftype *) putpkt, "k", "", RETURN_MASK_ERROR);
+  catch_errors (putpkt_for_catch_errors, "k", "", RETURN_MASK_ERROR);
 
   /* Don't wait for it to die.  I'm not really sure it matters whether
      we do or not.  For the existing stubs, kill is a noop.  */


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