Re: Note about include files

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: Note about include files
Дата
Msg-id 20001002025838.S27736@fw.wintelcom.net
обсуждение исходный текст
Ответ на Note about include files  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
* Peter Eisentraut <peter_e@gmx.net> [001002 02:51] wrote:
> The file "postgres.h" (or "c.h" or "config.h", whatever is used) needs to
> be the very *first* file included by each source file.  Next time you
> touch a source file, please check that this is the case.
> 
> The obvious failure mode is that if config.h redefines const, volatile, or
> inline then it will cause confusion when some system headers are included
> before and some after that definition.
> 
> The slightly more esoteric problem I encountered is that when you compile
> with CC='gcc -std=c99 -pedantic' on a glibc platform (i.e., "Linux") then
> you need to define _SVID_SOURCE and _BSD_SOURCE before including any
> system header in order to get the full feature set from the headers.
> 
> (Unfortunately, the flex output does not observe this rule either, so we
> can't be 100% pedantic warning safe without doing surgery on those files.)

gcc supports the '-include' directive which may be what you want.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Note about include files
Следующее
От: Peter Eisentraut
Дата:
Сообщение: libpq PGHOST