public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hinds <dhinds@valinux.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] removal of "static foo = 0" from drivers/ide (test11)
Date: Tue, 28 Nov 2000 12:58:40 -0800	[thread overview]
Message-ID: <20001128125840.A28888@valinux.com> (raw)

> What information is lost? Unless you're working on a really strange
> machine which does not zero bss, the following means the same from the
> codes point of view:
>
> static int foo = 0;
> static int foo; 

I think the argument is that "static int foo;" implies you don't
actually care how "foo" is initialized, but adding the "= 0" is
revealing that the code actually relies on the default value.  The
code is obviously equivalent.  It is a readability issue, not an issue
of what the code does.

I would contend that it is a compiler bug in gcc if it treats the two
statements differently, since they are trivially equivalent.  I guess
that it has been decided that linux kernel coding style dictates no
zero initializers, so that's that.  Personally, I prefer symmetry: if
I have a list of static variables initialized to various things, I
don't have to use a different form for ones that are zero initialized.

Did the savings really work out to be measured in kb's of space?  I
would have expected compression to eliminate most of the savings.

-- Dave
-
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/

             reply	other threads:[~2000-11-28 21:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-28 20:58 David Hinds [this message]
2000-11-28 21:08 ` [PATCH] removal of "static foo = 0" from drivers/ide (test11) Tigran Aivazian
2000-11-28 23:53   ` Peter Samuelson
2000-11-29  3:23     ` Keith Owens
2000-11-29  3:35       ` Peter Samuelson
2000-11-29  7:48     ` Tigran Aivazian
2000-11-29 14:00       ` Peter Samuelson
2000-11-29 14:08         ` Tigran Aivazian
  -- strict thread matches above, loose matches on Subject: below --
2000-11-29 16:16 Darryl Miles
2000-11-29 23:54 ` Russell King
2000-11-21 21:25 Bartlomiej Zolnierkiewicz
2000-11-21 22:55 ` J . A . Magallon
2000-11-21 23:04   ` Tigran Aivazian
2000-11-21 23:18     ` J . A . Magallon
2000-11-21 23:26       ` Tigran Aivazian
2000-11-21 23:30         ` J . A . Magallon
2000-11-23 11:01     ` Rusty Russell
2000-11-24 21:40       ` Vojtech Pavlik
     [not found]         ` <20001128031933.52DB981F5@halfway.linuxcare.com.au>
2000-11-28  8:59           ` Vojtech Pavlik
2000-11-24 23:13       ` J . A . Magallon
2000-11-25 12:01         ` Russell King
2000-11-25 11:50       ` Russell King
2000-11-25 23:56       ` Bartlomiej Zolnierkiewicz
2000-11-22  0:09   ` Jeff Garzik
2000-11-22 11:40   ` Russell King

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=20001128125840.A28888@valinux.com \
    --to=dhinds@valinux.com \
    --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