Hi,

Since at least 3.4, the GCC manual says:

     Use the `section' attribute with an _initialized_ definition of a
     _global_ variable, as shown in the example.  GCC issues a warning
     and otherwise ignores the `section' attribute in uninitialized
     variable declarations.

but this doesn't seem correct.

For example the Linux kernel creates several data sections mainly for
parking data which are only used during boot time and freed at
runtime.

Taken from the kernel source code (drivers/acpi/tables.c), this is how
such variable is stated:

static int acpi_apic_instance __attribute__ ((__section__ (".init.data")));

When compiling the driver, no warning is issued _and_ the section
attribute is not ignored. So either the documentation is wrong or the
compiler is misbehaving.

Could anybody clarify this point ?

Thanks,
                Franck

Reply via email to