[sheepdog] [PATCH] sheep: remove unnecessary extern keyword

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Jan 24 08:54:58 CET 2013


At Thu, 24 Jan 2013 15:43:30 +0800,
Liu Yuan wrote:
> 
> On 01/24/2013 03:24 PM, Liu Yuan wrote:
> > On 01/24/2013 03:18 PM, MORITA Kazutaka wrote:
> >> Is removing extern from global variables really correct?.  It means
> >> that the variables are defined in all .c files which include the
> >> header.  Actually, GCC complains the error when the global variables
> >> are initialized.
> > 
> > Umm, I used sed to replace all the 'extern' and fixed some warnings, and
> > yeah,global variables have this problem. My mistake.
> > 
> 
> But my GCC (4.6.3) don't complain on the missing extern for global
> variables. I guess new GCC might have some magic to handle this
> duplicate definition of global variables. Anyway, I've posted a patch to
> fix it.

So even if we define the same global name in different sources, GCC
doesn't complain it?  I think It can easily cause bugs and looks like
we need a mechanism to detect it.

Thanks,

Kazutaka



More information about the sheepdog mailing list