How to raise warning if return value is disregarded?

后端 未结 8 1013
北海茫月
北海茫月 2020-11-27 03:35

I\'d like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool?

Bad code exampl

8条回答
  •  爱一瞬间的悲伤
    2020-11-27 04:00

    a static analyzer will do the work for you, but if your code base is more then trivial prepare to be overwhelmed ;-)

提交回复
热议问题