From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10964 invoked by alias); 27 Mar 2013 10:47:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10910 invoked by uid 89); 27 Mar 2013 10:46:55 -0000 X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL autolearn=no version=3.3.1 Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 27 Mar 2013 10:46:52 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MKB00C00F5M6A00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Wed, 27 Mar 2013 12:46:29 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MKB00BM9F9HWC60@a-mtaout20.012.net.il>; Wed, 27 Mar 2013 12:46:29 +0200 (IST) Date: Wed, 27 Mar 2013 12:24:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Fix cygwin32 failure introduced by [patch] windows-nat.c: Fix offset problem in signal string handling In-reply-to: <005501ce2ac8$ae830150$0b8903f0$%muller@ics-cnrs.unistra.fr> To: Pierre Muller Cc: brobecker@adacore.com, gdb-patches@sourceware.org, vinschen@redhat.com Reply-to: Eli Zaretskii Message-id: <83obe5xgq2.fsf@gnu.org> References: <20130319151436.GB20727@calimero.vinschen.de> <20130319212554.GE4506@adacore.com> <000101ce2a6b$8c855a60$a5900f20$%muller@ics-cnrs.unistra.fr> <83y5d9xrqt.fsf@gnu.org> <005501ce2ac8$ae830150$0b8903f0$%muller@ics-cnrs.unistra.fr> X-SW-Source: 2013-03/txt/msg01012.txt.bz2 > From: "Pierre Muller" > Cc: , , > Date: Wed, 27 Mar 2013 09:54:23 +0100 > > ../../src/gdb/windows-nat.c: In function 'handle_output_debug_string': > ../../src/gdb/windows-nat.c:993:16: erreur: assignment makes pointer from integer without a cast Right. But IMO the casts here are dubious to begin with. strtoull produces a 64-bit value; casting it to a 32-bit uintptr_t might shut up the compiler, but it doesn't solve the fundamental problem, which is that a 64-bit value is being stuffed into a 32-bit wide pointer. A cleaner way would be something like sscanf (p, "%p", &x); If that doesn't satisfy the compiler, either, then the following code, which explicitly resets should be better than the double casts, IMO: unsigned long xul; ... xul = strtoull (p, NULL, 0) & ~((DWORD_PTR)0); x = (LPCVOID) xul; P.S. Yes, I hate casts, because they tend to conceal subtle bugs.