llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.32k stars 12.11k forks source link

ubsan fails to recognize overflows of unsigned types smaller than 'unsigned int' with -fsanitize=unsigned-integer-overflow #27262

Open llvmbot opened 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 26888
Version 3.7
OS Linux
Reporter LLVM Bugzilla Contributor
llvmbot commented 8 years ago

Please add to wishlist: Wouldn't it be useful, if 'clang -fsanitize=unsigned-integer-overflow' could warn for over-/underflows of all unsigned types instead of only 'unsigned int'? I don't see any other way to achieve this for types like 'unsigned short' or 'unsigned char' or bitfields.