Re: unchecked chdir warning

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unchecked chdir warning
Date: 2016-11-08 15:48:31
Message-ID: 23403.1478620111@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> I get the warning:

> ipc.c: In function 'proc_exit':
> ipc.c:137:3: warning: ignoring return value of 'chdir', declared with
> attribute warn_unused_result [-Wunused-result]
> chdir(gprofDirName);
> ^

> I don't know if there is anything useful that can be done if the chdir
> fails. What is the best way to silence the warning?

See, eg, aa90e148c.

It used to be considered good enough to explicitly cast the function
result to void, but the pedants who invented -Wunused-result refused
to honor that convention.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-11-08 15:54:16 Re: Hash Indexes
Previous Message Jeff Janes 2016-11-08 15:40:26 unchecked chdir warning