Re: beware of dead string constants

From: Jakub Jelinek (jakub@redhat.com)
Date: Tue Nov 21 2000 - 07:13:27 EST


On Tue, Nov 21, 2000 at 06:02:35AM -0600, Peter Samuelson wrote:
>
> 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.

gcc was never dropping such strings, I've commited a patch to fix this
a week ago into CVS.

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



This archive was generated by hypermail 2b29 : Thu Nov 23 2000 - 21:00:20 EST