From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28325 invoked by alias); 5 Jan 2007 14:44:54 -0000 Received: (qmail 28312 invoked by uid 22791); 5 Jan 2007 14:44:54 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 05 Jan 2007 14:44:49 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1H2qJE-0006Vq-8M; Fri, 05 Jan 2007 09:44:40 -0500 Date: Fri, 05 Jan 2007 14:44:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: RFC: MI - Detecting change of string contents with variable objects Message-ID: <20070105144440.GB24554@nevyn.them.org> Mail-Followup-To: Nick Roberts , Vladimir Prus , gdb-patches@sources.redhat.com References: <17797.65268.689590.797944@kahikatea.snap.net.nz> <20070104042038.GA3918@nevyn.them.org> <17820.39505.966623.305338@kahikatea.snap.net.nz> <200701050004.30631.ghost@cs.msu.su> <17821.42314.506114.619107@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17821.42314.506114.619107@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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/msg00188.txt.bz2 On Fri, Jan 05, 2007 at 02:09:30PM +1300, Nick Roberts wrote: > > Can you use > > > > strcmp (var->print_value, print_value) != 0 > > Is that more legible? I sometimes see "if (fi != NULL)" but "if (fi)" > seems clearer. Maybe it comes from programming in Lisp for Emacs. Speaking only for myself, I have no preference between "if (fi != NULL)" and "if (fi)", but I always use "!= 0" with strcmp; that's just because strcmp's return value is so frequently misused. The != 0 makes it clear that someone knew what result they were checking for. -- Daniel Jacobowitz CodeSourcery