Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Silence compilation warnings about setuid, setgid



On 13 Jun 2018, at 12:19, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
>+	(void)setgid(getgid());

Casting to void doesn't actually silence this warning with (at least some
versions of) GCC/glibc. If the function has the warn_unused_result attribute,
you have to (a) disable the warning entirely, (b) actually use the result
somehow, or (c) use some hack like this:
http://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/ignore-value.h

dana



Messages sorted by: Reverse Date, Date, Thread, Author