public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Rogier Wolff <R.E.Wolff@bitwizard.nl>
Cc: Peter Samuelson <peter@cadcamlab.org>,
	Patrick van de Lageweg <patrick@bitwizard.nl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Rogier Wolff <wolff@bitwizard.nl>
Subject: Re: [NEW DRIVER] firestream
Date: Thu, 23 Nov 2000 11:32:48 +0100	[thread overview]
Message-ID: <20001123113248.A2897@suse.cz> (raw)
In-Reply-To: <20001122234047.N2918@wire.cadcamlab.org> <200011230822.JAA05965@cave.bitwizard.nl>
In-Reply-To: <200011230822.JAA05965@cave.bitwizard.nl>; from R.E.Wolff@bitwizard.nl on Thu, Nov 23, 2000 at 09:22:09AM +0100

On Thu, Nov 23, 2000 at 09:22:09AM +0100, Rogier Wolff wrote:
> Peter Samuelson wrote:
> 
> > > +int loopback = 0;
> > > +int fs_debug = 0;
> > > +struct fs_dev *fs_boards = NULL;
>  
> > Aside from the 'static' issue already mentioned, these should be left
> > uninitialized.  ('gcc -fassume-bss-zero' would be nice, but then again
> > in userspace it rarely matters.)
> 
> Hi Peter, thanks for the feedback. 
> 
> Actually, I have an opinion on this matter: If the initialization
> value doesn't really matter that much, I like leave out the
> initialization, as you suggest.
> 
> However, if my code assumes that the compiler needs to initialize the
> variable one way or another, I want to put in the initialization, even
> if that means an "= 0;" which is already the default.
> 
> This is a form of documentation.

If it didn't matter in the object code, it would be just documentation.
But uninitialized variables are put into the .bss segment, which is not
included in the object (and is assumed to be zero on start), while
initialized ones (even to zero) are put into the .data segment, which
*is* in the object file.

Thus a difference of 12 bytes code size in your case (on a 32 bit system).

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

  parent reply	other threads:[~2000-11-23 11:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-22  9:32 [NEW DRIVER] firestream Patrick van de Lageweg
2000-11-22 17:23 ` Mitchell Blank Jr
2000-11-22 23:05   ` Rogier Wolff
2000-11-22 23:35     ` Jes Sorensen
2000-11-22 23:41       ` Jeff Garzik
2000-11-23 11:15   ` Rogier Wolff
2000-11-23 11:44     ` Peter Samuelson
2000-11-23 11:52       ` Rogier Wolff
2000-11-23 11:28   ` Werner Almesberger
2000-11-23  5:40 ` Peter Samuelson
2000-11-23  8:22   ` Rogier Wolff
2000-11-23  8:40     ` Peter Samuelson
2000-11-23 10:32     ` Vojtech Pavlik [this message]
2000-11-23 22:19 ` Bartlomiej Zolnierkiewicz
2000-11-23 23:43   ` Rogier Wolff
  -- strict thread matches above, loose matches on Subject: below --
2000-11-29  8:45 Patrick van de Lageweg
2000-12-06  8:45 Patrick van de Lageweg
2000-12-12 15:44 Patrick van de Lageweg
2000-12-15 12:07 Patrick van de Lageweg

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=20001123113248.A2897@suse.cz \
    --to=vojtech@suse.cz \
    --cc=R.E.Wolff@bitwizard.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick@bitwizard.nl \
    --cc=peter@cadcamlab.org \
    --cc=wolff@bitwizard.nl \
    /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