Re: new compiler warnings

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql(at)j-davis(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: new compiler warnings
Date: 2011-10-18 14:06:27
Message-ID: 1318946787.8007.6.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tis, 2011-10-18 at 09:32 -0400, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > It is a pity we can't just tell the compiler to turn off the warning in
> > a particular case.
>
> I haven't tested, but won't an explicit cast to void silence the
> warning?
>
> (void) fwrite(...);

No, tried that already. You could try

rc = write(...);
(void) rc;

> There are places, notably the calls in elog.c, where ignoring write
> failures is the right thing. I think that what Kevin was on about
> was something else entirely, namely whether we need to retry writes
> to disk. I would hope that we're not simply not bothering to check
> in any cases where it matters.

No, I believe we are OK everywhere else. We are only ignoring the
result in cases where we are trying to report errors in the first place.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-10-18 14:15:56 Re: new compiler warnings
Previous Message Magnus Hagander 2011-10-18 14:02:06 Re: pg_ctl restart - behaviour based on wrong instance