public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Clarification on section variable attribute usage
@ 2007-12-04 20:44 Franck Bui-Huu
  0 siblings, 0 replies; only message in thread
From: Franck Bui-Huu @ 2007-12-04 20:44 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-04 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04 20:44 Clarification on section variable attribute usage Franck Bui-Huu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).