From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17614 invoked by alias); 8 Nov 2012 17:04:45 -0000 Received: (qmail 17595 invoked by uid 22791); 8 Nov 2012 17:04:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,MSGID_MULTIPLE_AT,TW_CN X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Nov 2012 17:04:36 +0000 Received: from md15.u-strasbg.fr (md15.u-strasbg.fr [130.79.200.204]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA8H4RgV086952 ; Thu, 8 Nov 2012 18:04:27 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms13.u-strasbg.fr [130.79.204.113]) by md15.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA8H4QCG013154 ; Thu, 8 Nov 2012 18:04:26 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qA8H4Qq7009412 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Thu, 8 Nov 2012 18:04:26 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <20121107201107.25258.47267.stgit@brno.lan> In-Reply-To: <20121107201107.25258.47267.stgit@brno.lan> Subject: RE: [PATCH] Always include defs.h first. Date: Thu, 08 Nov 2012 17:04:00 -0000 Message-ID: <000301cdbdd3$1b0f7780$512e6680$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00198.txt.bz2 Hi Pedro, I think you missed the python subdirectory... $ grep \"defs\.h\" */*.h python/py-event.h:#include "defs.h" python/py-events.h:#include "defs.h" The C sources also do not all include defs.h ... Pierre Muller > -----Message d'origine----- > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=C3=A9 : mercredi 7 novembre 2012 21:11 > =C3=80 : gdb-patches@sourceware.org > Objet : [PATCH] Always include defs.h first. >=20 > defs.h should always be the first included header in a .c file. In > turn, this means that a foo.h header should not need to include > defs.h, as the .c file always includes defs.h before including foo.h. >=20 > I did >=20 > $ grep "\"defs\.h" *.c -B 3 | grep include | grep -v "\"defs" >=20 > and >=20 > $ grep "\"defs\.h" *.h >=20 > and hopefully caught all cases. >=20 > Applied. >=20 > 2012-11-07 Pedro Alves >=20 > * arm-tdep.c: Make defs.h be the first include. > * coff-pe-read.c: Ditto. > * gnu-nat.c: Ditto. > * go32-nat.c: Ditto. > * i386-nat.c: Ditto. > * ppcnbsd-nat.c: Ditto. > * ada-varobj.h: Don't include defs.h. > * i386-darwin-tdep.h: Ditto. > * i386-nat.h: Ditto. > --- > gdb/ada-varobj.h | 1 - > gdb/arm-tdep.c | 3 ++- > gdb/coff-pe-read.c | 3 ++- > gdb/gnu-nat.c | 3 ++- > gdb/go32-nat.c | 3 ++- > gdb/i386-darwin-tdep.h | 1 - > gdb/i386-nat.c | 2 +- > gdb/i386-nat.h | 2 -- > gdb/ppcnbsd-nat.c | 3 ++- > 9 files changed, 11 insertions(+), 10 deletions(-) >=20 > diff --git a/gdb/ada-varobj.h b/gdb/ada-varobj.h > index 2ef1a70..21f4cec 100644 > --- a/gdb/ada-varobj.h > +++ b/gdb/ada-varobj.h > @@ -20,7 +20,6 @@ > #ifndef ADA_VAROBJ_H > #define ADA_VAROBJ_H >=20 > -#include "defs.h" > #include "varobj.h" >=20 > struct value; > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index 05a030a..fbc2479 100644 > --- a/gdb/arm-tdep.c > +++ b/gdb/arm-tdep.c > @@ -18,9 +18,10 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . > */ >=20 > +#include "defs.h" > + > #include /* XXX for isupper (). */ >=20 > -#include "defs.h" > #include "frame.h" > #include "inferior.h" > #include "gdbcmd.h" > diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c > index 66c7c82..fd55170 100644 > --- a/gdb/coff-pe-read.c > +++ b/gdb/coff-pe-read.c > @@ -21,9 +21,10 @@ >=20 > Contributed by Raoul M. Gough (RaoulGough@yahoo.co.uk). */ >=20 > +#include "defs.h" > + > #include "coff-pe-read.h" >=20 > -#include "defs.h" > #include "bfd.h" > #include "gdbtypes.h" >=20 > diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c > index 2ca01e1..b34935e 100644 > --- a/gdb/gnu-nat.c > +++ b/gdb/gnu-nat.c > @@ -22,6 +22,8 @@ > along with this program. If not, see . > */ >=20 > +#include "defs.h" > + > #include > #include > #include > @@ -52,7 +54,6 @@ >=20 > #include >=20 > -#include "defs.h" > #include "inferior.h" > #include "symtab.h" > #include "value.h" > diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c > index d848017..ef1da91 100644 > --- a/gdb/go32-nat.c > +++ b/gdb/go32-nat.c > @@ -82,9 +82,10 @@ > GDB does not use those as of this writing, and will never need > to. */ >=20 > +#include "defs.h" > + > #include >=20 > -#include "defs.h" > #include "i386-nat.h" > #include "inferior.h" > #include "gdbthread.h" > diff --git a/gdb/i386-darwin-tdep.h b/gdb/i386-darwin-tdep.h > index 8be9946..4732b2d 100644 > --- a/gdb/i386-darwin-tdep.h > +++ b/gdb/i386-darwin-tdep.h > @@ -19,7 +19,6 @@ > #ifndef __I386_DARWIN_TDEP_H__ > #define __I386_DARWIN_TDEP_H__ >=20 > -#include "defs.h" > #include "frame.h" >=20 > /* Mapping between the general-purpose registers in Darwin x86 thread_st= ate > diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c > index e7d9b4d..559bc29 100644 > --- a/gdb/i386-nat.c > +++ b/gdb/i386-nat.c > @@ -18,8 +18,8 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . > */ >=20 > -#include "i386-nat.h" > #include "defs.h" > +#include "i386-nat.h" > #include "breakpoint.h" > #include "command.h" > #include "gdbcmd.h" > diff --git a/gdb/i386-nat.h b/gdb/i386-nat.h > index c06993c..be563ef 100644 > --- a/gdb/i386-nat.h > +++ b/gdb/i386-nat.h > @@ -20,8 +20,6 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . > */ >=20 > -#include "defs.h" > - > #ifndef I386_NAT_H > #define I386_NAT_H 1 >=20 > diff --git a/gdb/ppcnbsd-nat.c b/gdb/ppcnbsd-nat.c > index 8f73283..2b7837d 100644 > --- a/gdb/ppcnbsd-nat.c > +++ b/gdb/ppcnbsd-nat.c > @@ -19,13 +19,14 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . > */ >=20 > +#include "defs.h" > + > #include > #include > #include > #include > #include >=20 > -#include "defs.h" > #include "gdbcore.h" > #include "inferior.h" > #include "regcache.h"