Easy way find uninitialized member variables

后端 未结 11 954
时光说笑
时光说笑 2020-11-29 22:20

I am looking for an easy way to find uninitialized class member variables.

Finding them in either runtime or compile time is OK.

Currently

11条回答
  •  野性不改
    2020-11-29 22:46

    Valgrind (FREE, on Linux) and Purify (on Windows) find un-initialized variables, invalid pointers and such by running your code in a special virtual machine.

    This is easy to use and extremely powerful; it will likely find many bugs beyond the obvious un-initialized variables.

    Coverity, Klocwork and Lint can find un-initialized variables using static code analysis.

提交回复
热议问题