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.
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. I've said my peace, so however you guys want to deal with it, that's fine. At least a comment, though. On Wed, Jul 30, 2014 at 2:03 PM, Ed Maste <[email protected]> wrote: > On 30 July 2014 16:49, Todd Fiala <[email protected]> wrote: > > > > In this case, a comment is likely sufficient. > > How about a (static) assert that dwarf_r0 is 0, so that if someone > ever does change it then this comparison be revisited? > -- Todd Fiala | Software Engineer | [email protected] | 650-943-3180
_______________________________________________ lldb-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
