TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

SR:  7.8#1

Synopsis:The right operand of a shift operator in a constant expression must not be negative or imply too large a shift.
Language:C
Severity Level:3
Category:EXPRESSIONS


Description:

Such shifts lead to undefined behaviour. In general, only the constant case is statically detectable.

Example:

int array[ 32<<-3 ]; /* Undefined behaviour  */