Re: Extern variables in *.c files

From: Andrew Morton (akpm@zip.com.au)
Date: Thu Jan 03 2002 - 02:56:25 EST


"H . J . Lu" wrote:
>
> ...
> Compile doesn't emit the size info for
>
> extern char a;

You're right. I goofed.
 
> One way to fix it is to remove
>
> extern char a;
>
> and put
>
> extern int a;
>
> in a header file which is included by everyone.
>

Yup. Problem is, we have about 1500 instances in the kernel :(

(Wouldn't it be nice if `int a;' generated a compiler error
if a declaration `extern int a;' was not in scope?)

Oh well. Seems that disabling -fno-common and enabling
--warn-common is the only way to autodetect bugs such as this.

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:20 EST