[coreboot] [PATCH][v3] Check that CAR and ROM areas don't collide

Segher Boessenkool segher at kernel.crashing.org
Wed Dec 10 22:40:25 CET 2008


> is the last test below with 0x100000000 (2^32) in the formula  
> guaranteed
> to work or may cpp truncate the results to 32 bit? I'd rather avoid
> introducing a test that can never trigger.

[There doesn't really exist anything called "cpp" anymore -- you mean
to say "the C preprocessor"].

> #if CONFIG_CARBASE + CONFIG_CARSIZE + (CONFIG_COREBOOT_ROMSIZE_KB *  
> 1024) > 0x100000000

In C99, this is just fine.  I'm not sure about C90; indeed, in C90
there is no requirement to support integer types of more than 32 bits
at all!

You can always write "0x100000000LL" (or "ULL") instead, which isn't
C90 either, but GCC supports it anyway.

What compiler mode is coreboot compiled in, anyway?  I recommend we
should use GNU99 mode (-std=gnu99), for v3 at least.


Segher





More information about the coreboot mailing list