On Wed, Jan 07, 2009 at 05:49:12PM -0500, Tom Lane wrote:
> > It would be easy if the compiler were to have an option to throw a
> > warning when it finds a non-static variable that doesn't have a
> > corresponding extern declaration.
>
> Yeah, I think this is hopeless (or at least not worth the cost) without
> compiler support --- I was just idly wondering if newer gcc's might have
> such an option.
GNU ld has a --warn-common option which activates some warnings
relating to this. It won't check the type, but it will check the size.
It does note that this might produce spurious warnings due to
sloppiness in libraries, but it might help.
Have anice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.