Re: Windows build warnings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Windows build warnings
Дата
Msg-id 363416.1637901909@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Windows build warnings  (Greg Nancarrow <gregn4422@gmail.com>)
Ответы Re: Windows build warnings  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Greg Nancarrow <gregn4422@gmail.com> writes:
> AFAICS, the fundamental difference here seems to be that the GCC
> compiler still regards a variable as "unused" if it is never read,
> whereas if the variable is set (but not necessarily read) that's
> enough for the Windows C compiler to regard it as "used".

It depends.  Older gcc versions don't complain about set-but-not-read
variables, but clang has done so for awhile (with a specific warning
message about the case), and I think recent gcc follows suit.

> Personally I'm not really in favour of outright disabling the C4101
> warning on Windows, because I think it is a useful warning for
> Postgres developers on Windows for cases unrelated to the use of
> PG_USED_FOR_ASSERTS_ONLY.

IMO we should either do that or do whatever's necessary to make the
macro work properly on MSVC.  I'm not very much in favor of jumping
through hoops to satisfy a compiler that has a randomly-different-
but-still-demonstrably-inadequate version of this warning.

            regards, tom lane



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

Предыдущее
От: Greg Nancarrow
Дата:
Сообщение: Re: Windows build warnings
Следующее
От: Ken Kato
Дата:
Сообщение: [PATCH] ALTER tab completion