Re: pgsql: Add Bloom filter implementation.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add Bloom filter implementation.
Date: 2018-04-03 17:38:57
Message-ID: CAH2-WzkFTihZKe8aJLgC3Ox4odmk2NLd8Q9RspibNeu+r0qU=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Tue, Apr 3, 2018 at 8:39 AM, Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
> There is a compiler warning in the tests, with gcc-7:
>
> test_bloomfilter.c: In function 'test_bloomfilter':
> test_bloomfilter.c:40:38: error: '__builtin_snprintf' output may be
> truncated before the last format character [-Werror=format-truncation=]
> snprintf(element, sizeof(element), "i" INT64_FORMAT, i);
> ^
>
> This can be fixed by allocating one more byte for the possible sign, or
> doing the whole thing in unsigned.

I don't want to do the whole thing in unsigned, because this ties back
fairly directly to an int8 argument from the test_bloomfilter() SQL
function interface.

I proposed the attached, which makes the buffer one byte larger, per
your suggestion.

Thanks
--
Peter Geoghegan

Attachment Content-Type Size
0001-Fix-GCC-7-snprintf-compiler-warning.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2018-04-03 18:01:23 pgsql: C comment: mention null handling in BuildTupleFromCStrings()
Previous Message Magnus Hagander 2018-04-03 17:17:16 Re: pgsql: Validate page level checksums in base backups