From: Wolfgang Denk Date: Fri, 25 Jul 2008 06:28:16 +0200 Subject: [U-Boot-Users] [PATCH] Add include for config.h in command.h. In-Reply-To: Your message of "Thu, 24 Jul 2008 16:22:25 +0200." <1216909345-15346-1-git-send-email-sbabic@denx.de> Message-ID: <20080725042816.2AD98248A5@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1216909345-15346-1-git-send-email-sbabic@denx.de> you wrote: > Because the cmd_tbl_s structure depends on the configuration file, > it must be assured that config.h is included before the structure is > evaluated by the compiler. If this is not certain, it could happen > that the compiler generates structures of different size, depending > on the fact if the source file includes before or after > . > The effect is that u-boot crashes when tries to relocate the command > table (for ppc) or try to access to the command table for other > architectures. > The problem can happen on board-depending commands.All general > commands under /common are unaffected, because they include already > config.h before command.h. Agreed in principle, but... > Signed-off-by: Stefano Babic > --- > include/command.h | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/include/command.h b/include/command.h > index c3ef51d..8815937 100644 > --- a/include/command.h > +++ b/include/command.h > @@ -31,6 +31,8 @@ > #define NULL 0 > #endif > > +#include > + ...please move the #include *before* the #define. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A good marriage would be between a blind wife and deaf husband. -- Michel de Montaigne