lkml.org 
[lkml]   [2000]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] removal of "static foo = 0"
Date
Followup to:  <E13ztNR-0001ew-00@the-village.bc.nu>
By author: Alan Cox <alan@lxorguk.ukuu.org.uk>
In newsgroup: linux.dev.kernel
>
> That isnt what Andries is arguing about. Read harder. Its semantic differences
> rather than code differences.
>
> static int a=0;
>
> says 'I thought about this. I want it to start at zero. I've written it this
> way to remind of the fact'
>
> Sure it generates the same code
>

The problem is that it doesn't. One could argue this is a gcc bug or
rather missed optimization.

One can, of course, also write:

static int a /* = 0 */;
... to make it clear to human programmers without making gcc make bad
code.

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.197 / U:0.320 seconds]
©2003-2011 Jasper Spaans