Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Date: 2013-11-09 21:58:53
Message-ID: 1384034333.72555.YahooMailNeo@web162903.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Forwarding to -hackers.

----- Forwarded Message -----
> From: Kevin Grittner <kgrittn(at)ymail(dot)com>
> To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> Cc: "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
> Sent: Friday, November 8, 2013 3:19 PM
> Subject: Re: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
>
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
>

Attachment Content-Type Size
test_warnings.c text/x-csrc 289 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Kevin Grittner 2013-11-09 22:00:12 Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Previous Message Andres Freund 2013-11-09 14:13:14 Re: pgsql: Fix pg_isolation_regress to work outside its build directory.

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-11-09 22:00:12 Fw: [COMMITTERS] pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Previous Message Albe Laurenz 2013-11-09 20:46:56 Re: UTF8 national character data type support WIP patch and list of open issues.