From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9960 invoked by alias); 13 May 2002 13:30:36 -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 9897 invoked from network); 13 May 2002 13:30:31 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 13 May 2002 13:30:31 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D61803E10; Mon, 13 May 2002 09:30:40 -0400 (EDT) Message-ID: <3CDFC000.5000504@cygnus.com> Date: Mon, 13 May 2002 06:30:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0rc1) Gecko/20020429 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eli Zaretskii , Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix gdb/277 by separating types References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-05/txt/msg00453.txt.bz2 > 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.) Yes. > The same goes for casting the return value of xmalloc, I think. Yep. That one can have merit though. I personally use that XMALLOC macro (yes a macro I like :-). Having had to chase a few problems with memset VS void* in regbuf, I'm now (sadly) tempted to #define MEMSET(VAR, VAL) memeset (&(VAR), (VAL), sizeof (VAR)). Rest assured, neither are in GDB's coding standard. Andrew