This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
RFA: Fix a 64-bit pointer to integer-of-a-different-size cast error
- From: Kevin Buettner <kevinb at redhat dot com>
- To: insight at sourceware dot org
- Date: Thu, 26 Feb 2009 15:24:36 -0700
- Subject: 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. */