From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1531 invoked by alias); 28 Jan 2005 21:00:53 -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 1510 invoked from network); 28 Jan 2005 21:00:50 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 28 Jan 2005 21:00:50 -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 j0SL0mCq028154; Fri, 28 Jan 2005 22:00:48 +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 j0SL0ljM002197; Fri, 28 Jan 2005 22:00:48 +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 j0SL0hPG002192; Fri, 28 Jan 2005 22:00:43 +0100 (CET) Date: Fri, 28 Jan 2005 21:00:00 -0000 Message-Id: <200501282100.j0SL0hPG002192@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: cagney@gnu.org CC: gdb-patches@sources.redhat.com In-reply-to: <41FA9F7C.4030707@gnu.org> (message from Andrew Cagney on Fri, 28 Jan 2005 15:24:28 -0500) Subject: Re: [commit] Ada-valprint.c const tweaks References: <41FA9054.8050909@gnu.org> <200501282013.j0SKDbjU001907@elgar.sibelius.xs4all.nl> <41FA9F7C.4030707@gnu.org> X-SW-Source: 2005-01/txt/msg00289.txt.bz2 Date: Fri, 28 Jan 2005 15:24:28 -0500 From: Andrew Cagney Mark Kettenis wrote: > Date: Fri, 28 Jan 2005 14:19:48 -0500 > From: Andrew Cagney > > FYI, > Andrew > > This patch must be wrong! In C a string has type 'char *' and the > type of a single character is 'int'. If your compiler is warning > about incompatible types here, it's got a bug. This proves that > mindless replacement of 'char' with 'bfd_byte' is a stupid thing to > do. I've attached exibit A, the full patch that I'm merging. If you look carefully at printstr, you'll see that it's receiving in raw byte buffer _buffer_ and a _length_; not a null terminated "char *" string. That language code, such as scheme, print it using %s is well "somebody elses problem". Ah I see. The code in c-lang.c:c_printstr() is extracting bytes as integers. So sorry, yes you're right. I still think we should use 'void *' instead of 'bfd_byte *' though. Mark