Re: [HACKERS] unchecked chdir warning

2016-11-08 Thread Tom Lane
Jeff Janes  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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] unchecked chdir warning

2016-11-08 Thread Jeff Janes
When compiling with  --enable-profiling using:

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)

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?

Cheers,

Jeff