Re: Compaq Evo 510SFF and ACPI

Matthew Wilcox
2003-07-14T00:41:34Z

On Sun, Jul 13, 2003 at 05:33:09PM -0700, Grover, Andrew wrote:
> from include/linux/acpi.h:
>
> struct acpi_table_rsdt {
> struct acpi_table_header header;
> u32 entry[8];
> } __attribute__ ((packed));
>
> The RSDT actually contains an arbitrary number of entries. The precise
> number is determined by the length, which is in the header. The typical
> C way to accommodate this is to define an array of length 1 and then
> using the (theoretically) undefined behavior of accessing beyond the end
> of the array to access subsequent elements.

GCC has one extension to this (iirc entry[0]) and C99 takes an alternative
approach (iirc entry[]). So choose your poison ...

--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.