From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27284 invoked by alias); 28 Jan 2005 20:13:46 -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 27264 invoked from network); 28 Jan 2005 20:13:42 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 28 Jan 2005 20:13:42 -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 j0SKDeEF015340; Fri, 28 Jan 2005 21:13:40 +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 j0SKDdjM001910; Fri, 28 Jan 2005 21:13:39 +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 j0SKDbjU001907; Fri, 28 Jan 2005 21:13:37 +0100 (CET) Date: Fri, 28 Jan 2005 20:13:00 -0000 Message-Id: <200501282013.j0SKDbjU001907@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: cagney@gnu.org CC: gdb-patches@sources.redhat.com In-reply-to: <41FA9054.8050909@gnu.org> (message from Andrew Cagney on Fri, 28 Jan 2005 14:19:48 -0500) Subject: Re: [commit] Ada-valprint.c const tweaks References: <41FA9054.8050909@gnu.org> X-SW-Source: 2005-01/txt/msg00283.txt.bz2 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. Please stop it *right* now. Mark 2005-01-28 Andrew Cagney * ada-valprint.c (char_at, printstr): Make buffer a const bfd_byte. Index: ada-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/ada-valprint.c,v retrieving revision 1.17 diff -p -u -r1.17 ada-valprint.c --- ada-valprint.c 12 Jan 2005 18:31:30 -0000 1.17 +++ ada-valprint.c 28 Jan 2005 19:16:03 -0000 @@ -1,7 +1,7 @@ /* Support for printing Ada values for GDB, the GNU debugger. + Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1997, 2001, - 2002, 2003, 2004. - Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GDB. @@ -278,7 +278,7 @@ ada_emit_char (int c, struct ui_file *st or 2) of a character. */ static int -char_at (char *string, int i, int type_len) +char_at (const bfd_byte *string, int i, int type_len) { if (type_len == 1) return string[i]; @@ -439,8 +439,8 @@ ada_print_scalar (struct type *type, LON */ static void -printstr (struct ui_file *stream, char *string, unsigned int length, - int force_ellipses, int type_len) +printstr (struct ui_file *stream, const bfd_byte *string, + unsigned int length, int force_ellipses, int type_len) { unsigned int i; unsigned int things_printed = 0;