From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26798 invoked by alias); 11 Nov 2002 14:39:53 -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 26786 invoked from network); 11 Nov 2002 14:39:50 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 11 Nov 2002 14:39:50 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gABEGnw07519 for ; Mon, 11 Nov 2002 09:16:49 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gABEdnD18198; Mon, 11 Nov 2002 09:39:49 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gABEdmV32696; Mon, 11 Nov 2002 09:39:48 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 0E8DCFF7A; Mon, 11 Nov 2002 09:35:39 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15823.49211.871678.895830@localhost.redhat.com> Date: Mon, 11 Nov 2002 06:39:00 -0000 To: Andrew Cagney Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: PATCH: Remove unnecessary zero-initializations In-Reply-To: <3DCF2D6E.2030407@redhat.com> References: <20021111001910.GA17944@nevyn.them.org> <3DCF2D6E.2030407@redhat.com> X-SW-Source: 2002-11/txt/msg00304.txt.bz2 Andrew Cagney writes: > > Currently, thirteen files which provide a target_ops explicitly initialize > > members they don't support to NULL. I plan to delete a number of these > > methods, and rather than making sure I got all the necessary target files > > each time I just wanted to delete the unnecessary lines up-front. All of > > these are called-once functions initializing a statically or globally > > declared object; C will guarantee zero-initialization for us. And several > > of the functions explicitly called memset anyway. > > > > Besides, this way grepping for .to_require_attach\ = will only find targets > > which define it to something useful. > > > > I'll commit this tomorrow unless someone sees a problem with it. > > > > Note1: remote-st.c hasn't been compilable in a while; m68*-tandem-* is > > probably a good candidate for the hitlist. From a glance it looks like it > > has been broken since the HP merge added the NULL assignments I'm removing, > > which is about three years now I think. > > > > Note2: The DONT_USE member of struct target_ops can go now. > > The fact that 13 files were doing it should suggest that it was > intentional. Might want to wait a bit longer while someone dregs up the > history. > > Andrew > I remember a debate about this when the HP merge happened. Basically the initializations were deemed unnecessary, but they were already in, and nobody went back to clean them up. I agree with Felix that it would help with readability if it were done consistently, but it is not, so probably it makes things worse. Elena