lkml.org 
[lkml]   [2004]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectinitialize data not at file scope - WTF?
In include/linux/init.h, it says:

For initialized data:
You should insert __initdata between the variable name and equal
sign followed by value, e.g.:

static int init_variable __initdata = 0;
static char linux_logo[] __initdata = { 0x32, 0x36, ... };

Don't forget to initialize data not at file scope, i.e. within a
function, as gcc otherwise puts the data into the bss section and not
into the init section.

Does this mean that __initdata can't be used for file scope variables,
that it can only be used for file scope variables, or something else?

Thanks!

--
========================================================================
Ian Pilcher i.pilcher@comcast.net
========================================================================

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.032 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site