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

[PATCH] Fix format string related warnings in lin-lwp.c


I've just committed the patch below.  It fixes the warnings that were
recently introduced when I committed the process/thread/lwp id phase
3 patch.

Another way of fixing this problem is to cast the result of GET_LWP() to
an int.  However, this potentially results in a loss of information,
so I thought it was preferable to adjust the format strings instead.

	* lin-lwp.c (detach_callback, lin_lwp_wait, lin_lwp_pid_to_str):
	Adjust format strings for printing LWPs to account for the fact
	that the type returned by GET_LWP() is now a long instead of an
	int.

Index: lin-lwp.c
===================================================================
RCS file: /cvs/src/src/gdb/lin-lwp.c,v
retrieving revision 1.19
diff -u -p -r1.19 lin-lwp.c
--- lin-lwp.c	2001/05/15 00:03:36	1.19
+++ lin-lwp.c	2001/05/15 00:10:19
@@ -359,7 +359,7 @@ detach_callback (struct lwp_info *lp, vo
   gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
 
   if (debug_lin_lwp && lp->status)
-    fprintf_unfiltered (gdb_stdlog, "Pending %s for LWP %d on detach.\n",
+    fprintf_unfiltered (gdb_stdlog, "Pending %s for LWP %ld on detach.\n",
 			strsignal (WSTOPSIG (lp->status)), GET_LWP (lp->ptid));
 
   while (lp->signalled && lp->stopped)
@@ -676,7 +676,7 @@ lin_lwp_wait (ptid_t ptid, struct target
 	{
 	  if (debug_lin_lwp)
 	    fprintf_unfiltered (gdb_stdlog, 
-				"Using pending wait status for LWP %d.\n",
+				"Using pending wait status for LWP %ld.\n",
 				GET_LWP (lp->ptid));
 
 	  status = lp->status;
@@ -692,7 +692,7 @@ lin_lwp_wait (ptid_t ptid, struct target
     {
       if (debug_lin_lwp)
 	fprintf_unfiltered (gdb_stdlog, 
-			    "Waiting for specific LWP %d.\n",
+			    "Waiting for specific LWP %ld.\n",
 			    GET_LWP (ptid));
 
       /* We have a specific LWP to check.  */
@@ -704,7 +704,7 @@ lin_lwp_wait (ptid_t ptid, struct target
       if (debug_lin_lwp)
 	if (status)
 	  fprintf_unfiltered (gdb_stdlog, 
-			      "Using pending wait status for LWP %d.\n",
+			      "Using pending wait status for LWP %ld.\n",
 			      GET_LWP (lp->ptid));
 
       /* If we have to wait, take into account whether PID is a cloned
@@ -1024,7 +1024,7 @@ lin_lwp_pid_to_str (ptid_t ptid)
 
   if (is_lwp (ptid))
     {
-      snprintf (buf, sizeof (buf), "LWP %d", GET_LWP (ptid));
+      snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid));
       return buf;
     }
 


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