Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.
Date
Msg-id 2101.1227194829@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Re: [COMMITTERS] pgsql: Silence compiler warning about ignored return value.  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Autoconf, libpq and replacement function
Next
From: Tom Lane
Date:
Subject: Re: Error arguments in pl_exec.c