mirror of
https://github.com/nginx/nginx.git
synced 2024-11-24 04:49:01 +08:00
The official NGINX Open Source repository.
3d5a356abb
Previously, it could result when left-shifting signed integer due to implicit integer promotion, such that the most significant bit appeared on the sign bit. In practice, though, this results in the same left value as with an explicit cast, at least on known compilers, such as GCC and Clang. The reason is that in_addr_t, which is equivalent to uint32_t and same as "unsigned int" in ILP32 and LP64 data type models, has the same type width as the intermediate after integer promotion, so there's no side effects such as sign-extension. This explains why adding an explicit cast does not change object files in practice. Found with UndefinedBehaviorSanitizer (shift). Based on a patch by Piotr Sikora. |
||
---|---|---|
auto | ||
conf | ||
contrib | ||
docs | ||
misc | ||
src | ||
.hgtags |