From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28411 invoked by alias); 7 Feb 2010 14:10:27 -0000 Received: (qmail 28403 invoked by uid 22791); 7 Feb 2010 14:10:26 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail2.rz.htw-berlin.de (HELO mail2.rz.htw-berlin.de) (141.45.10.102) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Feb 2010 14:10:21 +0000 Envelope-to: gcc-help@gcc.gnu.org Received: from e178090214.adsl.alicedsl.de ([85.178.90.214] helo=[192.168.178.6]) by mail2.rz.htw-berlin.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1Ne7q7-000C9m-9v for gcc-help@gcc.gnu.org; Sun, 07 Feb 2010 15:10:19 +0100 Message-ID: <4B6EC9CA.7060904@htw-berlin.de> Date: Mon, 08 Feb 2010 00:25:00 -0000 From: Thomas Martitz Reply-To: thomas.martitz@student.htw-berlin.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100206 Lightning/1.0b1 Shredder/3.0.2pre MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: Cast void * to u_int References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HTW-SPAMINFO: this message was scanned by eXpurgate (http://www.eleven.de) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00100.txt.bz2 On 04.02.2010 19:37, Brian McGrew wrote: > DOH! > > I knew that. Much better now! (see what happens when you work all night > with no sleep!) > > -b > > > On 2/4/10 10:28 AM, "Adel Abushaev" wrote: > > >> u_int is always 32bit. >> >> A. >> >> On Thu, Feb 4, 2010 at 10:26 AM, Brian McGrew wrote: >> >>> Good morning! >>> >>> I have a line of code as follows (excuse erroneous capitulation, it's my >>> mailer) >>> >>> XtPointer client_data; // which is really void * >>> u_int days = reinterpret_cast(client_data); >>> >>> When I compile with gcc-4.1.2 I get: >>> >>> error: cast from 'void*' to 'u_int' looses precision >>> >>> This is the first time I've tried to rebuild this program with gcc-4, it was >>> previously build with gcc-2.95.2 (really old code but it works and is >>> simple). >>> >>> What am I missing here??? >>> >>> Thanks! >>> >>> -b >>> >>> >>> > Pointer-to-int conversion should always happen with intptr_t.