From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27804 invoked by alias); 1 Jul 2007 15:54:19 -0000 Received: (qmail 27794 invoked by uid 22791); 1 Jul 2007 15:54:19 -0000 X-Spam-Check-By: sourceware.org Received: from a.mail.sonic.net (HELO a.mail.sonic.net) (64.142.16.245) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 01 Jul 2007 15:54:17 +0000 Received: from snyder (209-204-172-156.dsl.dynamic.sonic.net [209.204.172.156]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with SMTP id l61FsBvP009625; Sun, 1 Jul 2007 08:54:11 -0700 Message-ID: <004a01c7bbf8$16a2ccc0$677ba8c0@sonic.net> Reply-To: "Michael Snyder" From: "Michael Snyder" To: "Daniel Jacobowitz" Cc: , References: <16087.12.7.175.2.1183076995.squirrel@webmail.sonic.net> <20070701154831.GE10872@caradoc.them.org> Subject: Re: [RFC] logic change in m2-valprint.c Date: Sun, 01 Jul 2007 15:54:00 -0000 X-Mailer: Microsoft Outlook Express 6.00.2800.1437 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-07/txt/msg00010.txt.bz2 > On Thu, Jun 28, 2007 at 05:29:55PM -0700, Michael Snyder wrote: > > I'm really not sure about this, call it a shot in the dark. > > > > The logic doesn't make sense as it is (the condition can't be true), > > so I figured maybe the conditional had been reversed by mistake. > > > > Either that, or the two lines should be removed, 'cause they're dead. > > > > > 2007-06-28 Michael Snyder > > > > * m2-valprint.c (m2_print_long_set): Logical condition reversed > > (Coverity). > > It can't be backwards; this is trying to print "1" or "1, 2" but your > change would make it print ", 1" and ", 12". > > I think it's also trying to shorten ranges to "{1..3, 6..7}". The > bug's got to be in there somewhere. Why's the code dead? I'm not > seeing it... element_seen can be reset by the bit clear case, and then > we'll get into the test you're changing again. 'Cause we're not in a loop, and it's not a static variable. The code is serial. At entry we set empty_set to one, and then we test to see if it's zero. It can't be zero.