From: "Yury V. Umanets" <umka-nJ1KrdHEGnBBDgjK7y7TUQ@public.gmane.org>
To: Matthew Wilcox <willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Cc: Jes Sorensen
<jes-dtAfj9ClZIwnoBwkMbRkTB2eb7JE58TQ@public.gmane.org>,
acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [patch] remove null-ifiers
Date: Tue, 27 Jan 2004 19:44:46 +0300 [thread overview]
Message-ID: <1075221885.26178.8.camel@firefly> (raw)
In-Reply-To: <20040127154314.GY11844-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
On Tue, 2004-01-27 at 18:43, Matthew Wilcox wrote:
> On Tue, Jan 27, 2004 at 04:09:55PM +0100, Karol Kozimor wrote:
> > > -static uid_t asus_uid = 0;
> > > -static gid_t asus_gid = 0;
> > > +static uid_t asus_uid;
> > > +static gid_t asus_gid;
> >
> > We certainly *don't* want to do that, last time I checked C did not
> > actually guarantee to zero out uninitialized variables -- unless it's
> > different in the kernelspace. Are you sure pointers are initialized as
> > NULLs?
>
> Looks like you checked the wrong standard then. Global variables are
> guaranteed to be zeroed, stack variables (ie function-local) have the
> behaviour you described. Jes' patch is correct.
Global uninitialized variables should be located in BSS section of ELF.
Then somebody should initialize BSS at the start of a program. In user
space this is done by crt.* small objects written in assembler and
built-in to each application by gcc.
In kernel space this should be done by kernel itself. And I guess, this
is done. So, I don't see any reasons to initialize global variables and
thus to make kernel data segment bigger...
--
umka
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
next prev parent reply other threads:[~2004-01-27 16:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-14 13:15 [patch] remove null-ifiers Jes Sorensen
[not found] ` <E1AgkrW-00080w-00-uLT3q8aHQDsX9StFTm9pZA@public.gmane.org>
2004-01-26 20:58 ` Len Brown
2004-01-27 15:09 ` Karol Kozimor
[not found] ` <20040127150954.GA12740-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-01-27 15:15 ` Jes Sorensen
[not found] ` <16406.32889.922823.45313-4mDQ13Tdud8Jw5R7aSpS0dP8p4LwMBBS@public.gmane.org>
2004-01-27 15:31 ` John Belmonte
[not found] ` <40168442.7020806-wanGne27zNesTnJN9+BGXg@public.gmane.org>
2004-01-27 15:35 ` Jes Sorensen
[not found] ` <16406.34107.51859.924117-4mDQ13Tdud8Jw5R7aSpS0dP8p4LwMBBS@public.gmane.org>
2004-01-30 7:09 ` Nate Lawson
2004-01-30 14:54 ` Matthew Wilcox
2004-01-27 21:29 ` Karol Kozimor
2004-01-27 15:43 ` Matthew Wilcox
[not found] ` <20040127154314.GY11844-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2004-01-27 16:44 ` Yury V. Umanets [this message]
2004-01-27 20:04 ` Nate Lawson
[not found] ` <20040127120357.X37323-Y6VGUYTwhu0@public.gmane.org>
2004-01-27 20:07 ` Karol Kozimor
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=1075221885.26178.8.camel@firefly \
--to=umka-nj1krdhegnbbdgjk7y7tuq@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=jes-dtAfj9ClZIwnoBwkMbRkTB2eb7JE58TQ@public.gmane.org \
--cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=willy-8fiUuRrzOP0dnm+yROfE0A@public.gmane.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