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

From Kevin Grittner
Subject Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
Date
Msg-id 1383928615.97932.YahooMailNeo@web162904.mail.bf1.yahoo.com
Whole thread Raw
In response to pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Fix blatantly broken record_image_cmp() logic for pass-by-value
List pgsql-committers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Fix blatantly broken record_image_cmp() logic for pass-by-value
> fields.
>
> Doesn't anybody here pay attention to compiler warnings?

> http://git.postgresql.org/pg/commitdiff/28858811472f316f73eba0e564837088fc8c6ccd

I don't get a warning on this with either of these compilers,
either with or without asserts enabled:

gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)

Bruce had reported a warning, and I was trying to establish whether
a particular change eliminated that warning when the above was
committed.  I really don't like the above "fix", since it only
suppresses the warning without fixing the fundamental problem --
which is that if there is a pass-by-value type with a disallowed
length the comparison would not generate an error in a no-assert
build.  The above patch only changes things from an unpredictable
wrong behavior to a predictable wrong behavior in such cases.

I think something like the attached would make more sense.

Can I get confirmation from someone who can create the warning that
the attached fixes it?

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

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix subtly-wrong volatility checking in BeginCopyFrom().
Next
From: Tom Lane
Date:
Subject: pgsql: Make contain_volatile_functions/contain_mutable_functions look i