☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

移位运算符右操作数为负数或超过相关类型比特位的数量

C++-Undefined-Behavior-47
目录 › next › previous

示例:

int a = 1 << -1;    // Undefined behavior
int b = 1 << 100;   // Undefined behavior

依据

ISO/IEC 14882:2003 5.8(1)-undefined ISO/IEC 14882:2011 5.8(1)-undefined

规则

ID_illShiftCount
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.