This is an archive of the discontinued LLVM Phabricator instance.

Silence the implicit signed/unsigned conversion warning.
ClosedPublic

Authored by logan on Jun 26 2014, 10:11 AM.

Details

Reviewers
thakis
Summary

This commit will silence various signed/unsigned conversion
warning by casting the value explicitly or changing the
variable type.

Diff Detail

Event Timeline

logan updated this revision to Diff 10894.Jun 26 2014, 10:11 AM
logan retitled this revision from to Silence the implicit signed/unsigned conversion warning..
logan updated this object.
logan edited the test plan for this revision. (Show Details)
logan added a reviewer: thakis.
logan added a subscriber: Unknown Object (MLST).
thakis accepted this revision.Jun 26 2014, 11:26 AM
thakis edited edge metadata.

Thanks!

src/Unwind/Unwind-EHABI.cpp
110

No need for the 0x

Also, since we know this is always 32bit code, you can just write ~1u (everywhere)

213

Huh, your compiler warns when widening a unsigned byte to an unsigned int? Interesting.

This revision is now accepted and ready to land.Jun 26 2014, 11:26 AM
rsmith added a subscriber: rsmith.Jun 26 2014, 11:57 AM
rsmith added inline comments.
src/Unwind/Unwind-EHABI.cpp
213

Both subexpressions of the | used to be of type signed int; the warning will be for converting the result of the | to unsigned.

logan closed this revision.Jun 27 2014, 10:27 AM

Thanks for your review. Committed as r211912 .

Note:

  • (uint32_t)0x1 is replaced with 1u to address the first suggestion.
  • The second suggestion w.r.t. RegisterRange() won't work due to the integer promotion rules, thus that line is committed as-is.