<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 1:04 PM, Lukas Slebodnik <span dir="ltr">&lt;<a href="mailto:lslebodn@redhat.com" target="_blank">lslebodn@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On (03/02/14 11:37), Sumit Bose wrote:<br>
&gt;On Mon, Feb 03, 2014 at 11:25:00AM +0100, Lukas Slebodnik wrote:<br>
&gt;&gt; On (03/02/14 10:11), Sumit Bose wrote:<br>
&gt;&gt; &gt;On Mon, Feb 03, 2014 at 09:19:49AM +0100, Lukas Slebodnik wrote:<br>
&gt;&gt; &gt;&gt; On (02/02/14 11:16), Noam Meltzer wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    return 0;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +}<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +static int sss_nfs_princ_to_ids(char *secname, char *princ, uid_t *uid,<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +                                gid_t *gid, extra_mapping_params **ex)<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +{<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    (void)secname;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    (void)princ;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    (void)uid;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    (void)gid;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; +    (void)ex;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Why these (void)s ?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;Best practice, IMHO. In case someone decided to enable &quot;<br>
&gt;&gt; &gt;&gt; &gt;-Wunused-parameter&quot; in the compile flags.<br>
&gt;&gt; &gt;&gt; &gt;(I prefer that over using gcc&#39;s __attribute__(unused) )<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; +1<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I have almost ready patches forr sssd to enable -Wunused-parameter<br>
&gt;&gt; &gt;&gt; and I also prefer casting to void, but I also add a comment e.g.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; sss_child_krb5_trace_cb(krb5_context context,<br>
&gt;&gt; &gt;&gt;                         const krb5_trace_info *info, void *data)<br>
&gt;&gt; &gt;&gt; {<br>
&gt;&gt; &gt;&gt;     (void) context; /* unused */<br>
&gt;&gt; &gt;&gt;     (void) data; /* unused */<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;I like this, but maybe a macro like MARK_AS_UNUSED or similar would make<br>
&gt;&gt; &gt;the purpose more clear and might help to avoid questions like to one<br>
&gt;&gt; &gt;above?<br>
&gt;&gt; &gt;<br>
&gt;&gt; But macro will need to be in separate header file, because we will need to use<br>
&gt;&gt; it also in the client code. This is a reason why I prefer to use comment and to<br>
&gt;&gt; avoid using macro. But separate header file can be acceptable solution.<br>
&gt;<br>
&gt;There are other examples, e.g. the SAFEALIGN macros, which are used by<br>
&gt;client and server code. The there is no existing header file where this<br>
&gt;now macro would fit, I&#39;m fine with creating a new one with the special<br>
&gt;purpose to hold stuff which is used by client and server code.<br>
&gt;<br>
</div></div>discard_const is defined in the util.h and it is not used in client code<br>
except the ssh client (src/sss_client/ssh/sss_ssh_knownhostsproxy.c)<br>
And it is not the same, because sss_ssh_knowhostproxy depends on<br>
libsss_util.so.<br></blockquote></div><div dir="ltr"><table cellpadding="0" cellspacing="0"><tbody><tr><td><br></td><td><br>switching back to the original subject -<br>since it is clear there&#39;s an ongoing process here, I will leave the void casting out of my patch for now.<br>
</td></tr></tbody></table></div>
</div></div>