From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26525 invoked by alias); 17 Dec 2001 15:30:08 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 26462 invoked from network); 17 Dec 2001 15:30:02 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.147.211.196) by sources.redhat.com with SMTP; 17 Dec 2001 15:30:02 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 0FB1C3E5D; Mon, 17 Dec 2001 10:30:02 -0500 (EST) Message-ID: <3C1E0F79.6050209@cygnus.com> Date: Mon, 17 Dec 2001 07:30:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.6) Gecko/20011207 X-Accept-Language: en-us MIME-Version: 1.0 To: Ian Lance Taylor Cc: binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: enum { BFD_ENDIAN_BIG, ...} References: <3C1D4919.1000102@cygnus.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00152.txt.bz2 > Andrew Cagney writes: > I didn't anticipate that the enum would be used in a field which was > not initialized in a normal fashion. I personally pretty much never > privilege a particular element of an enum; either the enum matches an > external definition, in which case all elements have explicit values, > or the enum does not match an external definition, in which case none > of the elements have explicit values. I don't normally initialize > structures using memset(0); I normally explicitly initialize all > fields in one way or another. I'm currently ``fixing'' gdb to explicitly initialize the relevant field. >> GDB, which is trying to eliminate its dependance on those host >> dependant macros is suffering minor heart burn as a result of the >> difference - it has been assuming that ZERO indicated an uninitialized >> (roughly BFD_ENDIAN_UNKNOWN) value. > It should not break BFD to change the order of the enum values. If it > does, I would consider that to be a bug. If you do change the order, > I would (obviously) recommend an explicit = 0, and a comment > indicating why BFD_ENDIAN_UNKNOWN has a zero value. I'll think about it. While something assuming zero might be a bug, I really don't want to break BFD. thanks for the history, Andrew