Re: pgsql: Add Bloom filter implementation. - Mailing list pgsql-committers

From Peter Geoghegan
Subject Re: pgsql: Add Bloom filter implementation.
Date
Msg-id CAH2-WzkFTihZKe8aJLgC3Ox4odmk2NLd8Q9RspibNeu+r0qU=g@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Add Bloom filter implementation.  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: pgsql: Add Bloom filter implementation.  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
On Tue, Apr 3, 2018 at 8:39 AM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.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

pgsql-committers by date:

Previous
From: Teodor Sigaev
Date:
Subject: pgsql: Add prefix operator for TEXT type.
Next
From: Bruce Momjian
Date:
Subject: pgsql: C comment: mention null handling in BuildTupleFromCStrings()