Why does the function even return a value? As Benjamin said, it is just a bunch of asserts with return 1 at the end.<div><br></div><div>I believe another way you can get rid of &quot;statement with no effect&quot; is to cast return value to void, like (void)_PyUnicode_CHECK(unicode).<br>
<div><br></div><div>Thank you,</div><div>Vlad<br><br><div class="gmail_quote">On Tue, Oct 4, 2011 at 4:57 AM, Benjamin Peterson <span dir="ltr">&lt;<a href="mailto:benjamin@python.org">benjamin@python.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2011/10/4 Victor Stinner &lt;<a href="mailto:victor.stinner@haypocalc.com">victor.stinner@haypocalc.com</a>&gt;:<br>
<div class="im">&gt; Le 04/10/2011 01:34, benjamin.peterson a écrit :<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://hg.python.org/cpython/rev/afb60b190f1c" target="_blank">http://hg.python.org/cpython/rev/afb60b190f1c</a><br>
&gt;&gt; changeset:   72633:afb60b190f1c<br>
&gt;&gt; user:        Benjamin Peterson&lt;<a href="mailto:benjamin@python.org">benjamin@python.org</a>&gt;<br>
&gt;&gt; date:        Mon Oct 03 19:34:12 2011 -0400<br>
&gt;&gt; summary:<br>
&gt;&gt;   fix compiler warnings<br>
&gt;&gt;<br>
&gt;&gt; +++ b/Objects/unicodeobject.c<br>
&gt;&gt; @@ -369,6 +369,12 @@<br>
&gt;&gt;      }<br>
&gt;&gt;      return 1;<br>
&gt;&gt;  }<br>
&gt;&gt; +#else<br>
&gt;&gt; +static int<br>
&gt;&gt; +_PyUnicode_CheckConsistency(void *op)<br>
&gt;&gt; +{<br>
&gt;&gt; +    return 1;<br>
&gt;&gt; +}<br>
&gt;&gt;  #endif<br>
&gt;<br>
&gt; Oh no, please don&#39;t do that. Calling _PyUnicode_CheckConsistency() is<br>
&gt; reserved to debug builds. In release mode, we should not check string<br>
&gt; consistency (it would slow down Python).<br>
<br>
</div>It should be optimized out.<br>
<div class="im"><br>
&gt;<br>
&gt; Yes, there was a warning:<br>
&gt;<br>
&gt; Objects/unicodeobject.c:539:13: warning: statement with no effect<br>
&gt;            _PyUnicode_CHECK(unicode);<br>
&gt;<br>
&gt; I added these checks recently to ensure that strings are consistent just<br>
&gt; before exiting (to help me to track down a bug).<br>
&gt;<br>
&gt; The right fix is just to replace _PyUnicode_CHECK(unicode) by<br>
&gt; assert(_PyUnicode_CHECK(unicode)).<br>
<br>
</div>But _PyUnicode_CheckConsistency is just a string of assertions. What<br>
sense does it make to check the return value?<br>
<font color="#888888"><br>
<br>
--<br>
Regards,<br>
Benjamin<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/riscutiavlad%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/riscutiavlad%40gmail.com</a><br>
</div></div></blockquote></div><br></div></div>