Re: [HACKERS] Significant oversight in that #include-removal script

2009-01-08 Thread Martijn van Oosterhout
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 c

Re: [HACKERS] Significant oversight in that #include-removal script

2009-01-07 Thread Bruce Momjian
Tom Lane wrote: > Alvaro Herrera writes: > > Bruce Momjian wrote: > >> The script certainly has no way to know it is missing an extern, and I > >> am not sure how I would even teach it that trick. > > > It would be easy if the compiler were to have an option to throw a > > warning when it finds a

Re: [HACKERS] Significant oversight in that #include-removal script

2009-01-07 Thread Tom Lane
Alvaro Herrera writes: > Bruce Momjian wrote: >> The script certainly has no way to know it is missing an extern, and I >> am not sure how I would even teach it that trick. > It would be easy if the compiler were to have an option to throw a > warning when it finds a non-static variable that does

Re: [HACKERS] Significant oversight in that #include-removal script

2009-01-07 Thread Alvaro Herrera
Bruce Momjian wrote: > The script certainly has no way to know it is missing an extern, and I > am not sure how I would even teach it that trick. > > The example you saw was: > > src/include/optimizer/cost.h:55:extern bool constraint_exclusion; > src/backend/optimizer/util/plancat.c:46:bool

Re: [HACKERS] Significant oversight in that #include-removal script

2009-01-07 Thread Bruce Momjian
Tom Lane wrote: > I just noticed that optimizer/cost.h is not #include'd by plancat.c, > which is not too cool because the former has the extern declaration > for the constraint_exclusion global variable while the latter has > the actual definition. I didn't run it down in the CVS history to > mak

[HACKERS] Significant oversight in that #include-removal script

2009-01-07 Thread Tom Lane
I just noticed that optimizer/cost.h is not #include'd by plancat.c, which is not too cool because the former has the extern declaration for the constraint_exclusion global variable while the latter has the actual definition. I didn't run it down in the CVS history to make sure, but I imagine what