public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: beware of dead string constants
@ 2000-11-23 23:29 Bernd Eckenfels
  2000-11-23 23:39 ` Jeff Garzik
  0 siblings, 1 reply; 13+ messages in thread
From: Bernd Eckenfels @ 2000-11-23 23:29 UTC (permalink / raw)
  To: linux-kernel

In article <14874.25691.629724.306563@wire.cadcamlab.org> you wrote:
> This is mostly a heads-up to say that in this regard gcc is not ready
> for prime time, so we really can't get away with using if() as an ifdef
> yet, at least not without penalty.

Humm.. whats the Advantage of this?

Greetings
Bernd
-
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: beware of dead string constants
@ 2000-11-26 14:29 Bernd Eckenfels
  0 siblings, 0 replies; 13+ messages in thread
From: Bernd Eckenfels @ 2000-11-26 14:29 UTC (permalink / raw)
  To: linux-kernel

In article <3A1DAAAD.28786302@mandrakesoft.com> you wrote:
> If you mean preferring 'if ()' over 'ifdef'... Linus.  :)  And I agree
> with him:  code looks -much- more clean without ifdefs.  And the
> compiler should be smart enough to completely eliminate code inside an
> 'if (0)' code block.

Oh I see. Well... hmmm... I think I have no Oppionion about that :)

Greetings
Bernd
-
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: beware of dead string constants
@ 2000-11-22 18:48 Michael Elizabeth Chastain
  2000-11-23 13:06 ` Werner Almesberger
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Elizabeth Chastain @ 2000-11-22 18:48 UTC (permalink / raw)
  To: jamagallon, peter; +Cc: jakub, linux-kernel

> Jakub Jelinek claims to have fixed this particular bug in the last week
> or so, although I have not downloaded and compiled recent CVS to verify
> this.

I have a compiler from gcc.gnu.org's CVS tree that's only a few days old,
so I can verify Jakub's claim.

It Works For Me (tm).

There is a considerable amount of engineering and testing and releasology
and distribution between "CVS compiler" and "production compiler for
kernel builds" though.

> and according to Jeff Law, this case is *not* fixed yet.

My compiler behaves as Jeff says.

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"
-
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/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* beware of dead string constants
@ 2000-11-21 12:02 Peter Samuelson
  2000-11-21 12:13 ` Jakub Jelinek
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Samuelson @ 2000-11-21 12:02 UTC (permalink / raw)
  To: jgarzik, linux-kernel


While trying to clean up some code recently (CONFIG_MCA, hi Jeff), I
discovered that gcc 2.95.2 (i386) does not remove dead string
constants:

  void foo (void)
  {
    if (0)
      printk(KERN_INFO "bar");
  }

Annoyingly, gcc forgets to drop the "<6>bar\0".  It shows up in the
object file, needlessly clogging your cachelines.

This has ramifications for anyone thinking of converting #ifdefs to
if(){}, which is supposed to be the way of the future.  In my situation
I am trying to convert '#ifdef CONFIG_MCA' to 'if (MCA_bus)' where
MCA_bus is #defined to 0 on most architectures.

'static' variables in block scope, same story.

This is mostly a heads-up to say that in this regard gcc is not ready
for prime time, so we really can't get away with using if() as an ifdef
yet, at least not without penalty.

I've just asked gcc-help@gcc.gnu.org about this; if I hear anything
interesting I'll report back.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2000-11-26 14:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-23 23:29 beware of dead string constants Bernd Eckenfels
2000-11-23 23:39 ` Jeff Garzik
2000-11-24  3:36   ` Peter Samuelson
2000-11-24  4:15   ` Chris Wedgwood
  -- strict thread matches above, loose matches on Subject: below --
2000-11-26 14:29 Bernd Eckenfels
2000-11-22 18:48 Michael Elizabeth Chastain
2000-11-23 13:06 ` Werner Almesberger
2000-11-21 12:02 Peter Samuelson
2000-11-21 12:13 ` Jakub Jelinek
2000-11-21 12:24   ` Peter Samuelson
2000-11-21 20:51   ` J . A . Magallon
2000-11-22  1:14     ` Peter Samuelson
2000-11-22  8:27       ` Urban Widmark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox