Menu

#7139 BBVS: Undefined behavior - shift of a negative value

open
nobody
None
5
2016-05-24
2016-05-24
No

In the Bug Justice minigame code, clang warns of bitwise shifts of a negative value, which are undefined behavior in C++:

engines/bbvs/minigames/bbant.cpp
591: obj->yIncr = (-1 << 16);
733: obj->x < (-10 << 16) || obj->x > (330 << 16) ||
734: obj->y < (-10 << 16) || obj->y > (250 << 16);
934: obj->yIncr = (-4 << 16);

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.