Re: additional GCC warnings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: additional GCC warnings
Дата
Msg-id 9353.1098035446@sss.pgh.pa.us
обсуждение исходный текст
Ответ на additional GCC warnings  (Neil Conway <neilc@samurai.com>)
Ответы Re: additional GCC warnings  (Neil Conway <neilc@samurai.com>)
Re: additional GCC warnings  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Recent versions of GCC support some additional warning flags that I 
> think would be useful to enable for building PostgreSQL:

> -Wmissing-declarations ("Warn if a global function is defined without a 
> previous declaration.")

Hm?  We have always used that one.

> -Wdeclaration-after-statement (Recent versions of GCC allow declarations 
> and statements to be intermixed in C; enabling this flag would enforce 
> the current convention of avoiding this style.)

Ick.  If the default is to allow that, then yes we need a warning.
I'd be fairly annoyed if it's not an error, in fact.

> Since some of these flags were added to GCC relatively recently, we 
> would probably need to test if the local gcc supports the flags via 
> configure.

Yeah, you would: it looks like gcc treats an unrecognized -W option
as an error:

$ gcc -Wabc z.c
cc1: Invalid option `-Wabc'
$ echo $?
1
$
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Nearing final release?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 7.4 changes