From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19533 invoked by alias); 13 May 2002 13:41:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19524 invoked from network); 13 May 2002 13:41:37 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 13 May 2002 13:41:37 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 177G52-000411-00; Mon, 13 May 2002 09:41:36 -0400 Date: Mon, 13 May 2002 06:41:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix gdb/277 by separating types Message-ID: <20020513134136.GA19484@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sources.redhat.com References: <20020513005352.GA16752@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2002-05/txt/msg00454.txt.bz2 On Mon, May 13, 2002 at 08:20:32AM +0300, Eli Zaretskii wrote: > > On Sun, 12 May 2002, Daniel Jacobowitz wrote: > > > This patch requires my previous cleanup patch. It fixes a test in > > gdb.c++/method.exp for GCC 3.x/stabs+, and closes gdb/277. > > A minor comment about style: > > > type = (struct type *) xmalloc (sizeof (struct type)); > > + memset ((char *) (type), 0, sizeof (struct type)); > > Why the cast to `char *' in the first argument of memset? I thought, > since we require an ISO C compiler, we shouldn't need those anymore. > (There are more casts like that in the patch.) > > The same goes for casting the return value of xmalloc, I think. Thanks for catching these. The reason is simple: they were all copies of a pre-existing memset in alloc_type, and I didn't stop to think about them :) -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer