Join GitHub today
Resolve cppcheck warnings #3392
Just for fun and giggles I tried to run cppcheck on the supercollider source code (checkout ea28126 of master branch) and it found some interesting problems:
line 189: Array 'phons' accessed at index 11, which is out of bounds.
line 407: Parameter 'bindTo' is passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++.
line 558: 'auto_ptr' destroys objects using operator 'delete'. But this object is created with new and therefore should be deleted with delete instead. Don't use auto_ptr objects created by new.
lines 845 and 858: Common realloc mistake: 'refs' is nulled but not freed upon failure
lines 175 and 361: Memory leak "names"
macro SEND_COMPLETION_MSG fails to initialize struct member: packet.mIsBundle
line 1291: va_list 'vargs' was opened but not closed by va_end()
line 194: No 'return' statement in non-void function causes undefined behavior
line 294: va_list 'vargs' was opened but not closed by va_end()
lines 37, 62, 79: The iterator 'it' is invalid after the element it pointed to has been erased. Dereferencing or comparing it with another iterator is invalid operation.
line 280: va_list 'vargs' was opened but not closed by va_end()
line 366: va_list 'vargs' was opened but not closed by va_end()
I guess we should write some boost projects? ;-)…
On 6 Jan 2018, at 21:38, shiihs ***@***.***> wrote: And now I notice I only examined the errors in the server directory... maybe it's easier if I just append the results in cppcheck's native xml format. result.txt — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.