lkml.org 
[lkml]   [2000]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] removal of "static foo = 0"
hpa@zytor.com (H. Peter Anvin)  wrote on 26.11.00 in <8vrstp$o7d$1@cesium.transmeta.com>:

> 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.

This (or similar) has the added advantage of making it obvious that this
is documentation, and not a superfluous initialization.

Sure, if you (generic you) look at your own code, you may know what it
means if it's written a certain way. But if you look at other's code, or
others look at your code, that is not clear. It is clear with a comment.


MfG Kai
-
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.068 / U:6.672 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site