From: Kevin Buettner <kevinb@redhat.com>
To: insight@sourceware.org
Subject: RFA: Fix a 64-bit pointer to integer-of-a-different-size cast error
Date: Thu, 26 Feb 2009 22:24:00 -0000 [thread overview]
Message-ID: <20090226152436.18951613@redhat.com> (raw)
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. */
next reply other threads:[~2009-02-26 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 22:24 Kevin Buettner [this message]
2009-03-02 22:48 ` Kevin Buettner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090226152436.18951613@redhat.com \
--to=kevinb@redhat.com \
--cc=insight@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).