Opened 13 years ago
Closed 12 years ago
#606 closed defect (fixed)
Checked 0ad sourcecode with cppcheck
Reported by: | Mr. X | Owned by: | |
---|---|---|---|
Priority: | If Time Permits | Milestone: | Alpha 1 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
I checked the sourcecode of 0ad with cppcheck (a static code analysis tool). It has found a couple of possible error and style problems. I attachet the log to this ticket.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | result.txt added |
---|
comment:1 by , 13 years ago
Thanks! Looking at the ones marked "Error":
[ps\Util.cpp:301]: (Error) Memory leak: tile_data
Fixed (r8302).
[scripting\ScriptGlue.cpp:275]: (Error) Null pointer dereference
That function is intended to crash.
[tools\atlas\AtlasObject\AtlasObjectXML.cpp:60]: (Error) Array 'buf[4]' index 4 out of bounds
False positive - I believe it's legal to take the address of the element just after the end of the array (as long as you don't dereference it, which we don't).
[tools\atlas\GameInterface\MessagesSetup.h:33]: (Error) Invalid number of character ({) when these macros are defined: ''. ...
Looks like probably a parser bug in cppcheck.
simulation\
and tools\ape\
and tools\pmdexp\
and tools\rmgen\
are all obsolete code and not used. (Should delete them some time...)
comment:2 by , 13 years ago
Milestone: | Unclassified → OS Alpha 2 |
---|
comment:3 by , 13 years ago
Milestone: | OS Alpha 2 → OS Alpha 3 |
---|
comment:4 by , 13 years ago
Priority: | major → trivial |
---|
comment:5 by , 13 years ago
Milestone: | Alpha 3 → Alpha 4 |
---|
comment:6 by , 13 years ago
Milestone: | Alpha 4 → Backlog |
---|
comment:7 by , 12 years ago
Milestone: | Backlog → Alpha 1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Result of cppcheck