From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29678 invoked by alias); 9 Apr 2003 20:44:58 -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 29662 invoked from network); 9 Apr 2003 20:44:55 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 9 Apr 2003 20:44:55 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h39Kii013049; Wed, 9 Apr 2003 13:44:44 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] missing #include in frame.h? References: <20030409203842.GN1170@gnat.com> From: David Carlton Date: Wed, 09 Apr 2003 20:44:00 -0000 In-Reply-To: <20030409203842.GN1170@gnat.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00174.txt.bz2 On Wed, 9 Apr 2003 16:38:42 -0400, Joel Brobecker said: > I am trying to see how much effort it needs to be able to build GDB on > LynxOS 4.0, and found that gcc emits the following warning: > frame.h:698: warning: `struct gdbarch' declared inside parameter list > frame.h:698: warning: its scope is only this definition or declaration, which is probably not what you want. > I am not sure whether we want to include gdbarch.h or not. Should we? > Or maybe we should be including "defs.h". Shall I go ahead and do that > (add #include "defs.h", and update Makefile.in)? My impression is that the right thing in these situations is normally to put an opaque declaration of the struct in question at the top of the header file: struct gdbarch; That way, header files can be included in any order without forcing them to include each other. But shouldn't all .c files inculde defs.h first? (Indeed, that's what GDB Internals says.) Which file were you compiling when you got this error? Probably that file should be fixed to include defs.h before frame.h, instead of changing frame.h. David Carlton carlton@math.stanford.edu