[PATCH] Warning for main returning a bool.

Joshua Hurwitz via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 10:17:59 PDT 2016


See attached.

Returning a bool from main is a special case of return type mismatch. The
common convention when returning a bool is that 'true' (== 1) indicates
success and 'false' (== 0) failure. But since main expects a return value
of 0 on success, returning a bool is usually unintended.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161014/8613cb71/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Warning-for-main-returning-a-bool.patch
Type: text/x-patch
Size: 3009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161014/8613cb71/attachment.bin>


More information about the cfe-commits mailing list