carlosgalvezp added a comment.

On the other hand, if the `0xFF` becomes `0xFFu`, then Clang performs an 
integer promotion to `unsigned int` instead of `int`, and that's why clang-tidy 
no longer complains.

I'm not sure that's correct behavior, however:

  If int can represent the entire range of values of the original type (or the 
range of values of the original bit field), the value is converted to type int. 
Otherwise the value is converted to unsigned int.

https://en.cppreference.com/w/c/language/conversion

In this case, an `int` can represent fully all values of an `uint8_t`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131678/new/

https://reviews.llvm.org/D131678

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to