From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16004 invoked by alias); 12 Jan 2007 12:11:01 -0000 Received: (qmail 15990 invoked by uid 22791); 12 Jan 2007 12:11:00 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Jan 2007 12:10:53 +0000 Received: from kahikatea.snap.net.nz (p202-124-120-193.snap.net.nz [202.124.120.193]) by viper.snap.net.nz (Postfix) with ESMTP id B8C883D83CF; Sat, 13 Jan 2007 01:10:49 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id DA04C4F6E9; Sat, 13 Jan 2007 01:10:47 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17831.31430.442855.801431@kahikatea.snap.net.nz> Date: Fri, 12 Jan 2007 12:11:00 -0000 To: Mark Kettenis Cc: vladimir@codesourcery.com, gdb@sources.redhat.com Subject: Re: MI failures related to string printing In-Reply-To: <200701121118.l0CBIh7p011299@brahms.sibelius.xs4all.nl> References: <200701121351.29310.vladimir@codesourcery.com> <200701121118.l0CBIh7p011299@brahms.sibelius.xs4all.nl> X-Mailer: VM 7.19 under Emacs 22.0.92.8 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00208.txt.bz2 > I think the whole idea of doing string comparisons for C (or C++) > "char *" pointers is flawed. There is no guarantee that a "char *" > actually points to a null-terminated as the test shows. You should > not treat "char *" any different from other pointers like "int *", at > least not by default. You could implement a way for the user to > specify that a "char *" is actually a pointer to a string instead of a > single character. But otherwise I think the string comparison should > only do for languages that have a genuine string type, such as Pascal. It's unfortunate you didn't express this opinion earlier. There are no gauarantees but generally if you are watching a "char *" type it points to something useful, or you learn something if it doesn't. Without string comparison you can't `watch' the contents of a string change. I think it's better to focus on such practical issues than pathological cases in the testsuite. -- Nick http://www.inet.net.nz/~nickrob