<div dir="ltr">You could do that, but the semantic content issue is deeper than that.  It's not only that r0 is 0, it's also that 0 is the bottom end of the range for the comparison value type (unsigned something or another).  The reason the compiler is warning is it happens to know that you can't have a value lower than 0, so comparing to 0 (which we aren't using in the expression, but the compiler is) is totally an optimization-related warning from a visual/maintenance perspective.<div>
<br></div><div>I think the comment is probably fine.  If it were me, I'd rewrite it as a range check against some kind of if in_range(low,high,value) or whatever.</div><div><br></div><div>I've said my peace, so however you guys want to deal with it, that's fine.  At least a comment, though.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 2:03 PM, Ed Maste <span dir="ltr"><<a href="mailto:emaste@freebsd.org" target="_blank">emaste@freebsd.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 30 July 2014 16:49, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>

><br>
> In this case, a comment is likely sufficient.<br>
<br>
</div>How about a (static) assert that dwarf_r0 is 0, so that if someone<br>
ever does change it then this comparison be revisited?<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>