mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: jt@hpl.hp.com, Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	tori@unhappy.mine.nu, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net #9
Date: Tue, 29 May 2001 19:01:52 -0700	[thread overview]
Message-ID: <20010529190152.A14806@bougret.hpl.hp.com> (raw)
In-Reply-To: <200105300048.CAA04583@green.mif.pg.gda.pl> <20010529180420.A14639@bougret.hpl.hp.com> <3B14493E.63F861E7@mandrakesoft.com> <20010529182506.A14727@bougret.hpl.hp.com> <3B145127.5B173DFF@mandrakesoft.com>
In-Reply-To: <3B145127.5B173DFF@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Tue, May 29, 2001 at 09:47:19PM -0400

On Tue, May 29, 2001 at 09:47:19PM -0400, Jeff Garzik wrote:
> Jean Tourrilhes wrote:
> > 
> > On Tue, May 29, 2001 at 09:13:34PM -0400, Jeff Garzik wrote:
> > >
> > > This is standard kernel cleanup that makes the resulting image smaller.
> > > These patches have been going into all areas of the kernel for quite
> > > some time.
> > 
> >         This doesn't make it right.
> > 
> >         Ok, while we are on the topic : could somebody explain me why
> > we can't get gcc to do that for us ? What is preventing adding a gcc
> > command line flag to do exactly that ? It's not like rocket science
> > (simple test) and would avoid to have tediously to go through all
> > source code, past, present and *future* to make those changes.
> >         Bah, maybe it's too straightforward...
> 
> This is ANSI C standard stuff.  If a static object with a scalar type is
> not explicitly initialized, it is initialized to zero by default.
> 
> Sure we can get gcc to recognize that case, but why use gcc to work
> around code that avoids an ANSI feature?

	Good standard don't mandate the implementation. And as
somebody doing some other language said, there is more than one way to
do it.
	ANSI C doesn't prohibit to initialise variable to zero
(AFAIK). ANSI C doesn't prevent the compiler to optimise for this
case. If I initialise the varaible 3 time to the same value in a row,
gcc will remove the other two.

	Let's put it another way... What's different between :
		for(i = 0; i < n; i++) xxx;
	And :
		i = 0; while(i++ < n) xxx;
	I would expect the compiler to produce code as efficient in
both cases, and leave the choice of coding style to the user.

	Jean

  reply	other threads:[~2001-05-30  2:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30  0:48 Andrzej Krzysztofowicz
2001-05-30  1:04 ` Jean Tourrilhes
2001-05-30  1:13   ` Jeff Garzik
2001-05-30  1:25     ` Jean Tourrilhes
2001-05-30  1:47       ` Jeff Garzik
2001-05-30  2:01         ` Jean Tourrilhes [this message]
2001-05-30  2:13           ` Jeff Garzik
2001-05-30  2:25             ` Jean Tourrilhes
2001-05-30 16:35           ` Hermann Himmelbauer
2001-05-30  2:13         ` Jean Tourrilhes
2001-05-30  2:17           ` Jeff Garzik
2001-05-30  9:33         ` Henning P. Schmiedehausen
2001-05-30 22:28       ` Pavel Machek
2001-05-30  9:32 ` Henning P. Schmiedehausen
2001-05-30 10:28   ` Andrzej Krzysztofowicz
2001-05-30 10:30   ` Keith Owens
2001-05-30 10:43     ` Henning P. Schmiedehausen
2001-05-30 10:30   ` Jeff Garzik

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=20010529190152.A14806@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ankry@green.mif.pg.gda.pl \
    --cc=jgarzik@mandrakesoft.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tori@unhappy.mine.nu \
    /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

all inboxes | Powered by JetHome®