Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Дата
Msg-id 1383945598.62616.YahooMailNeo@web162905.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value  (Kevin Grittner <kgrittn@ymail.com>)
Список pgsql-committers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> That is a serious compiler bug which you should file with your
> distro forthwith.

I distilled it down to the simplest case I could find which failed
to produce the warning; attached. Do you agree that it is a
compiler bug that this generates no warning?

Compile lines used:

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -fexcess-precision=standard -g -D_GNU_SOURCE -c -o
warning_test.o warning_test.c -MMD -MP

clang -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -g -D_GNU_SOURCE -c -o warning_test.o warning_test.c -MMD
-MP

It is probably significant that if I simplify the while loop
condition to just use one variable I do get the warning.

> It definitely does show up with what I'm using:
>         gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

The warning shows up, or the bug does?

> It might be worth trawling the buildfarm records to see which
> compilers did or didn't warn before.

I'll get this filed first with the version I'm using, then look
around to see if there is anything else to report.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix race condition in GIN posting tree page deletion.
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value