From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15653 invoked by alias); 3 May 2005 20:28:05 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 15628 invoked from network); 3 May 2005 20:28:01 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 3 May 2005 20:28:01 -0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j43KRsnD002726; Tue, 3 May 2005 22:27:54 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j43KRsVD001385; Tue, 3 May 2005 22:27:54 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j43KRsL4001021; Tue, 3 May 2005 22:27:54 +0200 (CEST) Date: Tue, 03 May 2005 20:28:00 -0000 Message-Id: <200505032027.j43KRsL4001021@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb@sources.redhat.com In-reply-to: <20050503195815.GA5300@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 3 May 2005 15:58:15 -0400) Subject: Re: Replace char * with something sensible References: <01c55019$Blat.v2.4$95304420@zahav.net.il> <20050503195815.GA5300@nevyn.them.org> X-SW-Source: 2005-05/txt/msg00038.txt.bz2 Date: Tue, 3 May 2005 15:58:15 -0400 From: Daniel Jacobowitz On Tue, May 03, 2005 at 10:51:02PM +0300, Eli Zaretskii wrote: > Rumor has it that latest versions of GCC whine about mixing "char *" > and "unsigned char *". To fix that, Andrew committed some patches > that replace these with a "bfd_byte *", but I think we should not use > BFD data types in GDB unless they refer to data structures returned by > functions from the BFD library. > > Possible solutions: > > . use "void *" (suggested by Mark Kettenis). > > . define a new data type gdb_byte and use "gdb_byte *". > > I think Mark's suggestion should be considered first, since it avoids > the pain of introducing yet another custom data type. I am marginally in favor of gdb_byte. What pain would it cause, besides a huge sed for the existing bfd_byte cases? I hope my (somewhat lengthy) post can change your mind ;-). These are byte-oriented buffers, so using a type where we can perform byte-oriented arithmetic without superfluous casts seems like a good choice to me. Converting to void * (and not using the GCC extension which allows arithmetic on void *) would be a painful process. We have -Wpointer-arith in our standard warning flags so there's no risk in us using that darn GCC extension. It's not as if non-8-bit-byte support is anywhere on our horizon. And it is probably completely irrelevant for this discussion. Mark