This is the mail archive of the insight@sourceware.org mailing list for the Insight 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]

RFA: Fix a 64-bit pointer to integer-of-a-different-size cast error


Below is another patch which fixes a problem encountered on a 64-bit
build host.  The error is as follows:

../../src/gdb/gdbtk/generic/gdbtk-stack.c: In function 'gdb_get_vars_command':
../../src/gdb/gdbtk/generic/gdbtk-stack.c:288: error: cast from pointer to integer of different size

I disliked adding yet another cast, but know of no elegant way to
solve this problem.

I did verify that it was safe to make this cast; gdb_get_vars_command() 
obtains clientData only from small integral values.  (The values in question
would fit in a byte, if necessary.)

Okay?

gdbtk/generic/ChangeLog:

	* generic/gdbtk-stack.c (gdb_get_vars_command): Cast `clientData'
	to avoid pointer to integer-of-a-different-size error.

Index: gdbtk/generic/gdbtk-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v
retrieving revision 1.31
diff -u -p -r1.31 gdbtk-stack.c
--- gdbtk/generic/gdbtk-stack.c	27 Oct 2008 18:40:12 -0000	1.31
+++ gdbtk/generic/gdbtk-stack.c	26 Feb 2009 22:10:43 -0000
@@ -285,7 +285,7 @@ gdb_get_vars_command (ClientData clientD
       return TCL_ERROR;
     }
 
-  arguments = (int) clientData;
+  arguments = (int) (long) clientData;
 
   /* Initialize the result pointer to an empty list. */
 


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