Clang not warning about implicit 32-bit conversion with +=
Clang not warning about implicit 32-bit conversion with +=
- Subject: Clang not warning about implicit 32-bit conversion with +=
- From: Jens Alfke <email@hidden>
- Date: Fri, 21 Apr 2017 19:25:21 -0700
Microsoft’s C++ compiler is warning about implicit 64-to-32-bit conversions in our code, which Clang doesn’t detect, even though we have -Wshorten-64-to-32 turned on. For example:
uint32_t shorter;
uint64_t longer;
…
shorter = longer; // Clang and MSVC both warn about implicit assignment to a 32-bit type
shorter += longer; // MSVC also warns about this, but Clang doesn’t
This seems like an oversight on Clang’s part, since the second expression is equivalent to `shorter = shorter + longer`, and the RHS of that is clearly 64 bits wide, making it equivalent to the first expression.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden