Closed Bug 1020892 Opened 5 years ago Closed 5 years ago
Bogus comparisons in js/src/jsstr
.cpp and js/src/vm/String .h
There are a bunch of "comparison ... is always true" warnings in these files.
Or "is always false".
I don't see these locally (Clang 3.4.1) but I see them in a TBPL log. This is from my Latin1 string patches; we templatized some code to work on both char types and something like "char <= 0xff" is always true for Latin1 chars. It's nice the compiler knows this because it can optimize away these branches for Latin1 strings, but we don't want the warnings of course.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
I don't get these warnings with GCC 4.8 either, but I see them with GCC 4.7. A jschar(c) cast is not enough to quell them; I had to add a jschar variable in StaticStrings::lookup. Anyway, it's cool the compiler can optimize these branches for Latin1 strings :)
Attachment #8434895 - Flags: review?(luke)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.