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)

result.txt (53.0 KB ) - added by Mr. X 13 years ago.
Result of cppcheck

Download all attachments as: .zip

Change History (8)

by Mr. X, 13 years ago

Attachment: result.txt added

Result of cppcheck

comment:1 by Philip Taylor, 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 Kieran P, 13 years ago

Milestone: UnclassifiedOS Alpha 2

comment:3 by Kieran P, 13 years ago

Milestone: OS Alpha 2OS Alpha 3

comment:4 by Kieran P, 13 years ago

Priority: majortrivial

comment:5 by Kieran P, 13 years ago

Milestone: Alpha 3Alpha 4

comment:6 by Kieran P, 13 years ago

Milestone: Alpha 4Backlog

comment:7 by historic_bruno, 12 years ago

Milestone: BacklogAlpha 1
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.