Re: A few warnings on Windows

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: A few warnings on Windows
Дата
Msg-id 20180502030550.rqb5gkz7h5om4ou3@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: A few warnings on Windows  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: A few warnings on Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2018-05-01 22:55:47 -0400, Peter Eisentraut wrote:
> On 5/1/18 16:48, Tom Lane wrote:
> > On more or less the same topic, I just scraped all the compiler warnings
> > for HEAD from the buildfarm database, and there seem to be a few other
> > things worth cleaning up.  One that I'm looking at is that recent gcc
> > has a -Wimplicit-fallthrough warning for switch branches not separated
> > by a "break" or similar.  It can be silenced with a comment similar to
> > /* FALLTHROUGH */, but we have not been entirely consistent about
> > providing such comments.  I'm inclined to run around and fix those
> > omissions.  Perhaps at some point we should have configure turn that
> > warning on if available?
> 
> I think it's useful, but I have found it a bit fickle at times.
> 
> One issue is <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79750>, which
> requires this additional patch

I've just committed a variant of this (moving, not duplicating the comment).


> Another issue that has prevented me in the past from taking this too
> seriously is requiring breaks after elog(ERROR) calls.  I see you bit
> the bullet and added those breaks, which is fair enough.  But if gcc
> ever fixes this bug
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79959), then as new code
> gets added without it, users of older compilers will start getting
> warnings.  So we might have to craft that configure test to detect that
> issue when that time comes.

As long as we don't make those warnings errors, do we really care that
much? Also, seems easy enough to fix if necessary.

Greetings,

Andres Freund


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Global snapshots
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Clean up warnings from -Wimplicit-fallthrough.