[PATCH] Warning for main returning a bool.

Joshua Hurwitz via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 13 15:11:23 PST 2016


Friendly ping. Any further thoughts on this suggested warning?

On Sat, Nov 5, 2016 at 1:48 PM Manuel Klimek <klimek at google.com> wrote:

> +richard
>
> On Fri, Oct 14, 2016 at 10:18 AM Joshua Hurwitz via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
> 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.
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161113/076a41bf/attachment.html>


More information about the cfe-commits mailing list