-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 3333 |
Resolution | FIXED |
Resolved on | Mar 12, 2010 00:57 |
Version | unspecified |
OS | All |
Reporter | LLVM Bugzilla Contributor |
Extended Description
When using operators ">>" or "<<", the valid range for the shift amount is [0, # bits in type).
GCC gives appropriate warnings when the shift amount is an out-of-range constant, such as:
"warning: right shift count is negative"
and
"warning: left shift count >= width of type"
However, clang does not present any warnings on the same code. An example input:
#include <stdio.h>
int main(void)
{
int i = 1;
printf("%d\n", i>>-1);
return 0;
}
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"