From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19342 invoked by alias); 3 Jul 2007 20:50:22 -0000 Received: (qmail 19333 invoked by uid 22791); 3 Jul 2007 20:50:22 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jul 2007 20:50:19 +0000 Received: (qmail 19808 invoked from network); 3 Jul 2007 20:50:18 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Jul 2007 20:50:18 -0000 To: Michael Snyder Cc: gdb-patches@sourceware.org Subject: Re: [OB] pointer ref, m2-typeprint.c References: <5515.12.7.175.2.1183077423.squirrel@webmail.sonic.net> <20070629004328.GA18113@caradoc.them.org> <9780.12.7.175.2.1183078961.squirrel@webmail.sonic.net> <20070629113703.GB13561@caradoc.them.org> <000f01c7ba7b$f2e3af20$677ba8c0@sonic.net> <20070701153309.GA10872@caradoc.them.org> From: Jim Blandy Date: Tue, 03 Jul 2007 20:50:00 -0000 In-Reply-To: <20070701153309.GA10872@caradoc.them.org> (Daniel Jacobowitz's message of "Sun, 1 Jul 2007 11:33:09 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-07/txt/msg00078.txt.bz2 Daniel Jacobowitz writes: > On Fri, Jun 29, 2007 at 11:33:08AM -0700, Michael Snyder wrote: >> I agree. It would be pretty simple to make CHECK_TYPEDEF safe, >> and I think I would rather do that than go hunt down every place that >> calls it. What do you think? Should I add that to this patch? >> >> It would add a "not equal to null" test to every call to CHECK_TYPEDEF, >> of which there are many, but on today's hardware the cost should be less >> than negligable... > > Do you think the case of a NULL type is at all common? I bet > everything that uses CHECK_TYPEDEF then looks inside the type, so if > we want null type checks, they'd be more useful before the > CHECK_TYPEDEF than inside it. I think CHECK_TYPEDEF ought to require a non-NULL pointer, as it does now. An explicit test should protect calls when the type might be NULL.