From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31148 invoked by alias); 11 Nov 2002 10:48:40 -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 31137 invoked from network); 11 Nov 2002 10:48:37 -0000 Received: from unknown (HELO jareth.dreamhost.com) (66.33.198.201) by sources.redhat.com with SMTP; 11 Nov 2002 10:48:37 -0000 Received: from hug.dreamhost.com (basic-cabo.hug.dreamhost.com [66.33.198.140]) by jareth.dreamhost.com (Postfix) with ESMTP id 19D306B5F7 for ; Mon, 11 Nov 2002 02:48:37 -0800 (PST) Received: from paper-wolf-solo.tigerfood.org (localhost [127.0.0.1]) by hug.dreamhost.com (8.11.0/8.9.3/Debian 8.9.3-21) with ESMTP id gABAmbV14798 for ; Mon, 11 Nov 2002 02:48:37 -0800 Received: from tigerfood.org (flee@localhost) by paper-wolf-solo.tigerfood.org (8.11.6/8.11.6) with ESMTP id gABAmXr01641 for ; Mon, 11 Nov 2002 02:48:37 -0800 Message-Id: <200211111048.gABAmXr01641@paper-wolf-solo.tigerfood.org> X-Authentication-Warning: paper-wolf-solo.tigerfood.org: flee owned process doing -bs From: Felix Lee Subject: Re: PATCH: Remove unnecessary zero-initializations To: gdb-patches@sources.redhat.com In-reply-to: <20021111001910.GA17944@nevyn.them.org> on Sun, 10 Nov 2002 19:19:10 EST. Date: Mon, 11 Nov 2002 02:48:00 -0000 X-SW-Source: 2002-11/txt/msg00302.txt.bz2 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. if the statement is missing, you have to spend time deciding if the programmer omitted it accidentally or not. a different technique is to put a note in a comment instead of as a statement: // foo.bar can be 0 but this is a pointless micro-optimization, it's an optimization a compiler could be taught how to do, and you lose the opportunity to have an automated tool check for you that initializations are complete. --