Re: new compiler warnings

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: new compiler warnings
Дата
Msg-id 4E9D32D8020000250004213C@gw.wicourts.gov
обсуждение исходный текст
Ответ на new compiler warnings  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: new compiler warnings
Re: new compiler warnings
Список pgsql-hackers
Jeff Davis  wrote:
> I'm not sure if these can/should be fixed or not, but here are the
> compiler warnings I'm getting on gcc and clang on ubuntu 11.10 with
> -O2.
> elog.c: In function ‘write_pipe_chunks’:
> elog.c:2479:8: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> elog.c:2488:7: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> elog.c: In function ‘write_console’:
> elog.c:1797:7: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> common.c: In function ‘handle_sigint’:
> common.c:247:4: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> common.c:250:4: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> common.c:251:4: warning: ignoring return value of ‘write’, declared
> with attribute warn_unused_result [-Wunused-result]
> In file included from mainloop.c:425:0:
These we are getting only because of a stubborn insistence on coding
to the current implementation rather than the API.  It's not that
much code to code to the API instead.  I've already offered to
provide the (trivial) patch for this if there is buy-in on the idea
of coding to the API.
The argument against is that no implementer of the API would ever
exercise the freedom the documented API gives them to do *part* of a
write to disk and return to the caller the number of bytes written
and then allow a subsequent write request to continue the output.  I
think that the rise of virtual machine environments in big shops
provides a fairly obvious reason someone might want to do that.
-Kevin


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: spinlocks on HP-UX
Следующее
От: Robert Haas
Дата:
Сообщение: Re: new compiler warnings