From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18644 invoked by alias); 27 Jan 2005 21:04:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17898 invoked from network); 27 Jan 2005 21:03:36 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 27 Jan 2005 21:03:36 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j0RL3YkS015433; Thu, 27 Jan 2005 22:03:34 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id j0RL3XV6001808; Thu, 27 Jan 2005 22:03:33 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id j0RL3TWS001805; Thu, 27 Jan 2005 22:03:29 +0100 (CET) Date: Thu, 27 Jan 2005 21:04:00 -0000 Message-Id: <200501272103.j0RL3TWS001805@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: cagney@gnu.org CC: gdb-patches@sources.redhat.com In-reply-to: <41F94AE7.4020405@gnu.org> (message from Andrew Cagney on Thu, 27 Jan 2005 15:11:19 -0500) Subject: Re: [commit] Tighten memory read/write methods References: <41F94AE7.4020405@gnu.org> X-SW-Source: 2005-01/txt/msg00264.txt.bz2 Date: Thu, 27 Jan 2005 15:11:19 -0500 From: Andrew Cagney Hello, This cleans up the {target_,}{read,write}_memory methods making the buffer parameter a bfd_byte (instead of "is it signed?" char) Just curious, but is that really an issue in these buffer-like contexts? I thought signed-ness is only an issue if there is an (implcit) conversion to an integer type involved. If there are such issues, bfd_byte seems like the appropriate type to use (but please read on), but otherwise I'd prefer using standard ISO C types. Anyway, isn't it better to sidestep the issue entirely, and use 'void *' in these contexts? That's what we have been doing in the past I think. Most 'char *' stuff is only there because too many people still remember K&R C. Anyway, I think we shouldn't change these things haphazardly. Can we formulate a set of programming guidelines such that we can try to be a bit more consistent. My set of rules would be: * Use const wherever possible. * Use 'void *' wherever possible. * Use 'char *' in context where you need to add an offset to a pointer. Mark