dhewm / dhewm3-sdk

An SDK to create Mods for dhewm3
GNU General Public License v3.0
62 stars 27 forks source link

[dantonmod] Resolve issues found by PVS studio #11

Open demoth opened 5 years ago

demoth commented 5 years ago

Hi guys

This is the report of issues found by static analysis tool PVS studio. I hope it will be helpful to identify potential and real bugs. Run over dantonmod branch https://docs.google.com/spreadsheets/d/1NZSJ1BfDV_ciyK0p6UvnkwAzURwMbdxChrRw4hXNpUQ/edit?usp=sharing

turol commented 5 years ago

I took a quick look and at least some of these are false positives caused by the analyzyer not knowing that idGameLocal::Error doesn't return.

Someone should tag that function (and others which don't return like the Error methods called by this function) with some kind of macro which expands to compiler-specific "does not return"-annotation. For GCC that is __attribute__((noreturn)). I have no idea if PVS understands it, someone check the documentation.