----- Original Message ----- > From: "Jakub Hrozek" <jhro...@redhat.com> > To: sssd-devel@lists.fedorahosted.org > Sent: Tuesday, January 27, 2015 8:35:20 PM > Subject: [SSSD] [PATCH] SELINUX: Check the return value of setuid and setgid > > Hi, > > As the automated test tools of our downstream discovered, selinux_child > now compiles with a warning if -Wunused-result is set: > > sssd-1.12.2/src/providers/ipa/selinux_child.c:227:15: warning: ignoring > return value of 'setgid', declared with attribute warn_unused_result > [-Wunused-result] > sssd-1.12.2/src/providers/ipa/selinux_child.c:223:15: warning: ignoring > return value of 'setuid', declared with attribute warn_unused_result > [-Wunused-result] > > Sorry I didn't catch this earlier, but I don't think we can do much about > the error anyway, just warn.
Does the warning go away if you cast the result to |(void)|, e.g. |(void)setuid(666)| ? Classical UNIX programming coding style (basically enforced by lint(1) defaults) is that each unused function return value must be casted to |(void)|. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) rma...@redhat.com \__\/\/__/ IPA/Kerberos5 team /O /==\ O\ (;O/ \/ \O;) _______________________________________________ sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/sssd-devel