All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Bradley <tojabr@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] A question about uninitializing static variables
Date: Tue, 29 Mar 2005 16:39:22 +0000	[thread overview]
Message-ID: <ac62433050329083911598ae@mail.gmail.com> (raw)
In-Reply-To: <40875.158.102.162.5.1112106681.squirrel@picard.linux.it>

the default for gcc is `-fzero-initialized-in-bss', the kernel
makefile does not change this therefore bss is zeroed, this is
documented in the gcc manpage.

Tom



On Tue, 29 Mar 2005 16:31:21 +0200 (CEST), Carlo Perassi <carlo@linux.it> wrote:
> Hi.
> One of the tasks at http://janitor.kernelnewbies.org/TODO
> is described as
> 
> "
> uninitialize static variables initialized to 0, to make it go to the
> .bss, instead of .data.
> "
> 
> I made two patches for two maintainers which uninitialize some static
> int used as module parameters and actually initialized to 0.
> 
> One maintainer do not have problems with the patches but the maintainer
> of the file the second patch refers to would like to have some kind of
> "proof" that "it is still guaranteed that those variables will be
> initialized to 0". I wrote him something like "this simple hello module
> shows it is still guaranteed..." but it's not enough for him. I guess
> he'd like a more formal explanation of the following statement:
> 
> An uninitialized static variable of {the kernel, a kernel module} will
> be compiled to go to the .bss and it is guaranteed that will be
> "zero-ed" there.
> 
> Is there someone with a link or something I could send to this
> maintainer to show him the reasons why the previous statement is true?
> Maybe it could be useful to put this reference in the TODO itself.
> 
> Thanks.
> 
> --
> Carlo Perassi - http://www.linux.it/~carlo/
> 
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
>
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2005-03-29 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-29 14:31 [KJ] A question about uninitializing static variables Carlo Perassi
2005-03-29 16:16 ` Howell, David P
2005-03-29 16:39 ` Tom Bradley [this message]
2005-03-30 19:34 ` Carlo Perassi

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=ac62433050329083911598ae@mail.gmail.com \
    --to=tojabr@gmail.com \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.