From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20412 invoked by alias); 26 Feb 2009 22:24:51 -0000 Received: (qmail 20398 invoked by uid 22791); 26 Feb 2009 22:24:49 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Feb 2009 22:24:40 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1QMOcbm026775 for ; Thu, 26 Feb 2009 17:24:38 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1QMOctX026086 for ; Thu, 26 Feb 2009 17:24:38 -0500 Received: from localhost.localdomain (vpn-14-57.rdu.redhat.com [10.11.14.57]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1QMObai020730 for ; Thu, 26 Feb 2009 17:24:37 -0500 Date: Thu, 26 Feb 2009 22:24:00 -0000 From: Kevin Buettner To: insight@sourceware.org Subject: RFA: Fix a 64-bit pointer to integer-of-a-different-size cast error Message-ID: <20090226152436.18951613@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00015.txt.bz2 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. */