Re: ERROR: do not initialise externals to 0 or NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 5 Jul 2010, Dan Carpenter wrote:

> On Mon, Jul 05, 2010 at 06:16:55PM +0200, Joe Eloff wrote:
> > Hi,
> > 
> > I have searched for results on this and most things I find is that it
> > must be dropped.
> > 
> 
> You mean something like:
> 
> extern int foo = 0;
> 
> initializing an extern doesn't make sense.  It doesn't matter what you
> initialize it to.  Gcc should warn about this.  The initialization should
> go where the actual variable is declared.
> 
> If that doesn't answer your question, can you send some sample code
> that causes the error?

For what it is worth, I didn't find anything with the following semantic 
match:

@@
type T;
identifier x;
expression E;
@@

* extern T x = E;

This, if there actually is such a thing, I would be interested to know 
about it.

julia
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux