How to get g++ to warn on unused member variables

前端 未结 3 584
傲寒
傲寒 2021-02-12 23:34

g++ generates warnings for unused local variables. Is it possible to have g++ warn for unused class member variables and/or global variables?

class Obj {
 public         


        
3条回答
  •  逝去的感伤
    2021-02-12 23:38

    You can use cppcheck (download). cppcheck --enable=style does exactly what you need, among other useful things.

提交回复
热议问题