From: Ian Pilcher <i.pilcher@comcast.net>
To: linux-kernel@vger.kernel.org
Subject: initialize data not at file scope - WTF?
Date: Mon, 12 Jan 2004 15:35:26 -0600 [thread overview]
Message-ID: <4003131E.1090408@comcast.net> (raw)
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
========================================================================
next reply other threads:[~2004-01-12 21:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-12 21:35 Ian Pilcher [this message]
2004-01-12 21:54 ` initialize data not at file scope - WTF? Richard B. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4003131E.1090408@comcast.net \
--to=i.pilcher@comcast.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox