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
Clang misses a shift count warning found by GCC.
cat shift.c
#include <stdio.h> typedef enum shiftof { OFA_FM_POL_ERROR = (1<<32) } shiftof_t; int main() { printf ("%u %lu %lu\n", OFA_FM_POL_ERROR, sizeof(OFA_FM_POL_ERROR), sizeof(shiftof_t)); }
$ ./bin/clang -Wall shift.c (no warning) $ gcc -Wall shift.c shift.c:3:26: warning: left shift count >= width of type [-Wshift-count-overflow] OFA_FM_POL_ERROR = (1<<32) ^~ $ gcc --version gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10) $ ./bin/clang --version clang version 16.0.0 (https://github.com/llvm/llvm-project 6daa983c9dde7608bcaa20b11e4a7d28fab4e003)
The text was updated successfully, but these errors were encountered:
Proposed fix: https://reviews.llvm.org/D141192
Sorry, something went wrong.
Need review
No branches or pull requests
Clang misses a shift count warning found by GCC.
The text was updated successfully, but these errors were encountered: