Thread: warn_unused_result in pgbench

warn_unused_result in pgbench

From
Peter Eisentraut
Date:
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.





Re: warn_unused_result in pgbench

From
Robert Haas
Date:
On Wed, Jun 19, 2013 at 9:38 PM, Peter Eisentraut <peter_e@gmx.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