Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.
От | Magnus Hagander |
---|---|
Тема | Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value. |
Дата | |
Msg-id | 4925837B.4040601@hagander.net обсуждение исходный текст |
Ответ на | Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value. (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
Tom Lane wrote: > Magnus Hagander <magnus@hagander.net> writes: >> Heikki Linnakangas wrote: >>> 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. > > I think you must have a broken version of gcc. I don't like this > patch either. The (void) is the standard way and should work; > futhermore, if you're getting a warning here, why aren't you getting > a whole lot of others? It's not like we are careful to use (void) > everywhere. It's: gcc (Ubuntu 4.3.2-1ubuntu11) 4.3.2 Error was: pg_regress.c:282: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result It's because system() is flagged with __attribute(warn_unused_result)__. That's why we're not seeing it for other functions. There's a paragraph about the difference in the GCC docs. If that's in the new versions of gcc, I expect it to show up on other platforms as well as time passes. //Magnus
В списке pgsql-hackers по дате отправления: