From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12494 invoked by alias); 16 Jan 2007 02:08:48 -0000 Received: (qmail 12485 invoked by uid 22791); 16 Jan 2007 02:08:46 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 16 Jan 2007 02:08:42 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1H6dkX-0005XX-8Q for gdb-patches@sources.redhat.com; Tue, 16 Jan 2007 05:08:38 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1H6dkH-0005Wy-Lu; Tue, 16 Jan 2007 05:08:18 +0300 From: Vladimir Prus Subject: Re: MI failures related to string printing To: Nick Roberts , gdb-patches@sources.redhat.com Date: Tue, 16 Jan 2007 02:08:00 -0000 References: <200701121351.29310.vladimir@codesourcery.com> <17831.31430.442855.801431@kahikatea.snap.net.nz> User-Agent: KNode/0.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00351.txt.bz2 Nick Roberts wrote: > > 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. Is there any chance you'll robustify the testsuite? Thanks, Volodya