C++ code analysis tools

后端 未结 8 2178
误落风尘
误落风尘 2021-02-06 07:49

I\'m currently in the process of learning C++, and because I\'m still learning, I keep making mistakes.
With a language as permissive as C++, it often takes a long time to f

8条回答
  •  不要未来只要你来
    2021-02-06 08:35

    Turning on all compiler warnings (at least initially) and then understanding what they mean, how to fix the problems highlighted and which of the warnings represent genuine constructs that compiler writers might consider ambiguous is a good first step.

    If you need something more heavy duty, you could try PC-Lint if you're on Windows, which is still one of the best lint tools for C++. Just keep in mind that you'll need to configure these tools to reflect your coding style, otherwise you'll get swamped with warnings and won't be able to see the wood for the trees. Yes, it costs money and it's probably a bit overkill if you're not doing C++ on a "getting paid for it" level, but I find it invaluable.

提交回复
热议问题