[coreboot] [PATCH]AMDHT misbehaves on recent compilers

Kevin O'Connor kevin at koconnor.net
Thu Jan 7 05:23:26 CET 2010


On Thu, Jan 07, 2010 at 02:06:18AM +0100, Stefan Reinauer wrote:
> Here's a simple test case if someone wants to try other tools:
> 
> #include <stdio.h>
> const char *func_foo(void)
> {
>     const char *foo="foobar\n";

I don't think the above is a problem (the pointer foo resides on the
stack, but the string contents do not).  The following is a problem:

    const char foo[]="foobar\n";

(both the pointer and the array contents are on the stack), and indeed
this does generate a warning from gcc.

Also, had  AMD_CB_ManualBUIDSwapList() returned a  pointer to swaplist
instead  of  returning it  via  a parameter  then  it  too would  have
generated a warning.

-Kevin




More information about the coreboot mailing list