Обсуждение: warn_unused_result in pgbench

Поиск
Список
Период
Сортировка

warn_unused_result in pgbench

От
Peter Eisentraut
Дата:
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

От
Robert Haas
Дата:
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