Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.
Дата
Msg-id 4925826E.9090604@gmx.net
обсуждение исходный текст
Ответ на Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Magnus Hagander <magnus@hagander.net>)
Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Magnus Hagander wrote:
> Heikki Linnakangas wrote:
>> Magnus Hagander wrote:
>>> Log Message:
>>> -----------
>>> Silence compiler warning about ignored return value. Our comment already
>>> clearly stated that we are aware that we're ignoring it.
>> I think the usual way is to call the function like:
>>
>>  (void) function_with_return_value()
> 
> I tried that first, of course. gcc is too smart about that - it still
> throws the warning in this case.

Well, the warning is explicitly put in there for this specific function 
because you are supposed to process the return value.  I'm sure a more 
smarter compiler would even warn "variable is assigned a value that is 
never used". ;-)  (Note that gcc in general doesn't work about unused 
return values, only for those functions that glibc explicitly marks as 
candidates.)

It looks like you are building in fortify mode?  I tried that a while 
ago and got a few more warnings.  Are we trying to be fortify clean, and 
if so, what is our approach?

Also, considering my recent complaint about various brittleness in the 
regression test driver, more well hidden ignorings of errors are not 
exactly my favorite solution.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error arguments in pl_exec.c
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Updates of SE-PostgreSQL 8.4devel patches (r1197)