Re: Significant oversight in that #include-removal script

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Significant oversight in that #include-removal script
Дата
Msg-id 20090107220712.GF14891@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Significant oversight in that #include-removal script  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Significant oversight in that #include-removal script  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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 constraint_exclusion = false;
> 
> The only clean way I can think of to fix this would be to have all the
> globals in a single C file that is included as part of postgres.h. 

Agreed, it seems pretty difficult.  Another insane idea is to grep all
the header files and make sure that no header contains an identically
named variable to a variable not marked static.

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.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: [BUGS] BUG #4186: set lc_messages does not work
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Latest version of Hot Standby patch