We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The left shift of a signed integer is officially undefined behavior in C++17 and earlier: https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators
In C++20, signed integers are officially two's-complement, so left-shift becomes well defined: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html.
Consider to fix it by generating the following code instead of a << b:
a << b
a * (1 << b);
This is issue is connected to the Zserio issue #671.
The text was updated successfully, but these errors were encountered:
[#50] Implement left shift operator by multiplication for signed values
1b63df4
[#50] [#51] Fix gcc conversion warnings in constants and initializers
64d061a
a7191c0
79248d0
[#50] Fix left shift formatting for 64-bit operands
22a5c88
ccf3b49
mikir
No branches or pull requests
The left shift of a signed integer is officially undefined behavior in C++17 and earlier: https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators
In C++20, signed integers are officially two's-complement, so left-shift becomes well defined: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html.
Consider to fix it by generating the following code instead of
a << b
:This is issue is connected to the Zserio issue #671.
The text was updated successfully, but these errors were encountered: