[PATCH] Silence the implicit signed/unsigned conversion warning.

Nico Weber thakis at chromium.org
Thu Jun 26 12:26:15 PDT 2014


On Thu, Jun 26, 2014 at 11:57 AM, Richard Smith <richard at metafoo.co.uk>
wrote:

> ================
> Comment at: src/Unwind/Unwind-EHABI.cpp:213
> @@ -211,3 +212,3 @@
>  uint32_t RegisterRange(uint8_t start, uint8_t count_minus_one) {
> -  return (start << 16) | (count_minus_one + 1);
> +  return ((uint32_t)start << 16) | ((uint32_t)count_minus_one + 1);
>  }
> ----------------
> Nico Weber wrote:
> > Huh, your compiler warns when widening a unsigned byte to an unsigned
> int? Interesting.
> Both subexpressions of the `|` used to be of type `signed int`; the
> warning will be for converting the result of the `|` to `unsigned`.
>

Ah, right. Might be simpler to just add a u suffix to the two literals then.


>
> http://reviews.llvm.org/D4315
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140626/3310378a/attachment.html>


More information about the cfe-commits mailing list