Opened 10 years ago
Closed 10 years ago
#1145 closed defect/bug (fixed)
Fix integer overflows detected by -ftrapv
Reported by: | sleske | Owned by: | KaZeR |
---|---|---|---|
Priority: | minor | Milestone: | version 0.5.1 |
Component: | core | Version: | git master |
Severity: | Keywords: | quality, testing, gcc | |
Cc: |
Description
gcc has a switch "-ftrapv" to detect signed integer overflow (which is undefined behaviour according to the C spec).
Compiling navit with -ftrapv (using the CMake switch -DCMAKE_C_FLAGS=" -ftrapv " ) shows numerous problems. These should be fixed, as each one is a (potential) bug.
Change History (4)
comment:1 Changed 10 years ago by sleske
comment:2 follow-up: ↓ 4 Changed 10 years ago by usul
- Keywords quality testing added
- Milestone set to version 0.5.1
Thats great, thank you Sleske :) Maybe you can give us a report on how much candidates you identified?
comment:3 Changed 10 years ago by usul
- Keywords gcc added
comment:4 in reply to: ↑ 2 Changed 10 years ago by sleske
- Resolution set to fixed
- Status changed from new to closed
Replying to http://wiki.navit-project.org/index.php/user:usul:
Thats great, thank you Sleske :) Maybe you can give us a report on how much candidates you identified?
The changes are committed now, as r5544,r5545,r5546,r5547.
The actual problems varied a bit: Two were regular overflows, where the values used were just too big. Two were actually caused by using a variable that was not properly initialized, which caused silly intermediate values which then overflowed.
Anyway, should be fixed now :-).
I'm working on this, patches coming soon :-).