Re: warn_unused_result in pgbench

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: warn_unused_result in pgbench
Date: 2013-07-02 21:45:52
Message-ID: CA+TgmoZvsEdR+_gYu_dvCpiBLyTd7ert8V_sd8gic4cgaRo6-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 19, 2013 at 9:38 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> When building without thread safety, I get the following compiler
> warning in pgbench:
>
> pgbench.c:2612:2: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result]
> write(th->pipes[1], ret, sizeof(TResult));
>
> That should be fixed, I think.

We can stick a cast-to-void in there if that helps. Or we could have
the process exit(1) or exit(42) or something in that case. But then
pthread_join() would also need to get smarter, as would its callers.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ian link 2013-07-03 00:16:18 Re: Review: query result history in psql
Previous Message Michael Paquier 2013-07-02 21:39:51 Re: [9.4 CF 1] The Commitfest Slacker List