From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14899 invoked by alias); 13 Nov 2002 19:01:26 -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 14869 invoked from network); 13 Nov 2002 19:01:25 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 13 Nov 2002 19:01:25 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gADIcCw20960 for ; Wed, 13 Nov 2002 13:38:12 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gADJ1Lx25932; Wed, 13 Nov 2002 14:01:22 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id gADJ1HH10046; Wed, 13 Nov 2002 11:01:21 -0800 Message-ID: <3DD2A17D.C770432A@redhat.com> Date: Wed, 13 Nov 2002 11:01:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Felix Lee CC: gdb-patches@sources.redhat.com Subject: Re: PATCH: Remove unnecessary zero-initializations References: <200211111048.gABAmXr01641@paper-wolf-solo.tigerfood.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00383.txt.bz2 Felix Lee wrote: > > Daniel Jacobowitz : > > Currently, thirteen files which provide a target_ops explicitly initialize > > members they don't support to NULL. > > this is a style and readability issue. if every set of > initializations is complete and mentions all members, even > when "unnecessary", then it's easier to quickly check that > an implementation correctly matches the specification. a > statement like > foo.bar = 0; > indicates that the programmer was aware that foo.bar exists, > thought about it, and decided that 0 is a correct value. This is counter to the intention. We made the initializations un-necessary on purpose, so that when a new target method gets added, you don't have to go add a new " = NULL;" to every file that doesn't implement it.