[U-Boot] [PATCH 3/3 v2] Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value

Wolfgang Denk wd at denx.de
Tue Oct 26 23:12:33 CEST 2010


Dear Alessandro Rubini,

In message <20101026205756.GA2139 at morgana.i.gnudd.com> you wrote:
>
> Instead of:
> 
>      DEFINE(GENERATED_GBL_DATA_SIZE,
>              (sizeof(struct global_data)+15) & ~15);
> 
> I'd use:
> 
>      DEFINE(GENERATED_GBL_DATA_SIZE,
>              (sizeof(struct global_data)),
> 
> leaving the alignment requirement in the structure itself
> (include/asm/global_data.h for each architecture).

Is it guaranteed (I mean by the C standard) that the alignment of a
struct (which affects only the possible start address) also has effect
on the sizeof() for that struct, in the sense that sizeof() is
guaranteed to be a multiple of that alignment requirement?

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
panic: kernel trap (ignored)


More information about the U-Boot mailing list