[clang-tools-extra] Add new check: do not return 0; at the end of main() in C++ (PR #77586)

Bhuminjay Soni via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 07:39:37 PST 2024


11happy wrote:

> I agree with the opinions from Aaron And Piotr above - this check does the opposite of readability: it forces people to waste time digging into the Standard to find the quote that says the return is not needed.
> 
> Could some argumentation be provided as to why this would be a good check to have? What coding guidelines/best practice articles promote this? I cannot think of any category where it would fit (besides misc).
> 
> I believe this is a nano-optimization, and premature optimization is the root of all evil :)

Actually I don't have any points to put forward for this PR,It would be forcing it but , As a new contributor I got to learn a lot how to write clang-tidy checks etc ,I just choose to solve this issue as it mentioned good first issue and has certainly helped me to know more about the org and clang in a lot.

Thank you .

https://github.com/llvm/llvm-project/pull/77586


More information about the cfe-commits mailing list