On 2020-11-10 04:34, Michael Paquier wrote:
I am not sure
about the addition of repalloc(), as it is quite obvious that one has
to use its result. Lists are fine, these are proper to PG internals
and beginners tend to be easily confused in the way to use them.
realloc() is listed in the GCC doc
On Mon, Nov 09, 2020 at 08:23:31AM +0100, Peter Eisentraut wrote:
> On 2020-11-09 07:56, Michael Paquier wrote:
>> This is accepted by clang, and MSVC has visibly an equivalent for
>> that, as of VS 2012:
>> #elif defined(_MSC_VER) && (_MSC_VER >= 1700)
>> #define pg_nodiscard _Check_return_
>> We
On 2020-11-09 07:56, Michael Paquier wrote:
This is accepted by clang, and MSVC has visibly an equivalent for
that, as of VS 2012:
#elif defined(_MSC_VER) && (_MSC_VER >= 1700)
#define pg_nodiscard _Check_return_
We don't care about the 1700 condition as we support only >= 1800 on
HEAD, and in th
On Sat, Oct 17, 2020 at 08:57:51AM +0200, Peter Eisentraut wrote:
> Forgetting to assign the return value of list APIs such as lappend() is a
> perennial favorite. The compiler can help point out such mistakes. GCC has
> an attribute warn_unused_results. Also C++ has standardized this
On 2020-10-17 17:58, Tom Lane wrote:
Peter Eisentraut writes:
Forgetting to assign the return value of list APIs such as lappend() is
a perennial favorite. The compiler can help point out such mistakes.
GCC has an attribute warn_unused_results. Also C++ has standardized
this under the name
Peter Eisentraut writes:
> Forgetting to assign the return value of list APIs such as lappend() is
> a perennial favorite. The compiler can help point out such mistakes.
> GCC has an attribute warn_unused_results. Also C++ has standardized
> this under the name "nodisc
Forgetting to assign the return value of list APIs such as lappend() is
a perennial favorite. The compiler can help point out such mistakes.
GCC has an attribute warn_unused_results. Also C++ has standardized
this under the name "nodiscard", and C has a proposal to do the same
[