From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18347 invoked by alias); 5 Jun 2008 20:27:04 -0000 Received: (qmail 18338 invoked by uid 22791); 5 Jun 2008 20:27:03 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jun 2008 20:26:44 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id F036798371; Thu, 5 Jun 2008 20:26:41 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B43609809F; Thu, 5 Jun 2008 20:26:41 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1K4M2i-0000wI-RQ; Thu, 05 Jun 2008 16:26:40 -0400 Date: Thu, 05 Jun 2008 20:27:00 -0000 From: Daniel Jacobowitz To: Pierre Muller Cc: 'Mark Kettenis' , pedro@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [PING2] : [RFC/RFA] PING: skip __main Message-ID: <20080605202640.GL25085@caradoc.them.org> Mail-Followup-To: Pierre Muller , 'Mark Kettenis' , pedro@codesourcery.com, gdb-patches@sourceware.org References: <004f01c8ac58$06a1ddb0$13e59910$@u-strasbg.fr> <000c01c8c246$de300f50$9a902df0$@u-strasbg.fr> <200805301157.m4UBvOL5009408@brahms.sibelius.xs4all.nl> <001901c8c256$06f8be00$14ea3a00$@u-strasbg.fr> <001a01c8c263$f493b1d0$ddbb1570$@u-strasbg.fr> <200805301457.m4UEvnGD028393@brahms.sibelius.xs4all.nl> <000301c8c2ea$0c2d72a0$248857e0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000301c8c2ea$0c2d72a0$248857e0$@u-strasbg.fr> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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 X-SW-Source: 2008-06/txt/msg00071.txt.bz2 On Sat, May 31, 2008 at 08:46:25AM +0200, Pierre Muller wrote: > Should I use the 32bit typecast strategy: > > unsigned int32 pc_after = pc + 5; > unsigned int32 depl = extract_unsigned_integer (buf, 4); > > unsigned int32 dest = pc_after - depl; > pc = dest; > > I don't know the checks done in C, > are there any overflow checks in code like this, > or is it safe to assume that it will work, > even on machine that perform their operations > on more than 32 bits? If you use uint32_t, then you are guaranteed wrapping at 32 bits. So that is probably the best thing to do. See the patch I just posted to make stdint.h available everywhere. -- Daniel Jacobowitz CodeSourcery