Hello! Almost completed glib + Geany cppcheck config which leads to few new errors in code:
I removed some false-pos.
What do you think about goto-ing? Most leaks are because of return without free. Using goto instead of return and only one return at the end should be a good pattern which has no return-leaks (at least).
Here is a new config (for Geany): https://gist.github.com/scriptum/7294264
Plugins update: https://gist.github.com/scriptum/7282262
-- Best regards, Pavel Roschin aka RPG
Le 03/11/2013 21:22, Pavel Roschin a écrit :
Hello! Almost completed glib + Geany cppcheck config which leads to few new errors in code:
Thanks, I fixed the leaks, but the mismatched allocator was false-positive.
I removed some false-pos.
What do you think about goto-ing? Most leaks are because of return without free. Using goto instead of return and only one return at the end should be a good pattern which has no return-leaks (at least).
Well, it could be (I use it in some projects, though I tend to abuse ifs to keep a linear code flow) but it's really not the norm in Geany code so I'm not sure. Moreover most of the leaks in your report could not easily be avoided with a goto; and the code that lead to them is very ugly (e.g. in create_config_dir()) and should rather be rewritten cleanly than patched with a goto.
Regards, Colomban
Am 03.11.2013 21:22, schrieb Pavel Roschin:
Almost completed glib + Geany cppcheck config which leads to few new errors in code:
Maybe we can improve the make check for both, geany and geany-plugins so developer can profit from improved config.
Cheers, Frank
I think similar config for Geany should be generated from Geany's source and utils. Maybe there is a way to automate this? Of course if there was doxymentation...
-- Best regards, Pavel Roschin aka RPG