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

前端 未结 3 1004
自闭症患者
自闭症患者 2021-02-12 23:29

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:54

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

提交回复
热议问题