[cfe-commits] [PATCH] Re-enabled and fixed fixit for main returning non-int

Joerg Sonnenberger joerg at britannica.bec.de
Wed Mar 16 19:45:45 PDT 2011


On Wed, Mar 16, 2011 at 09:39:31PM -0500, Ryan Gerleve wrote:
> Sounds good to me. But thinking about Johannes' question - does
> 'extern' have semantic value when applied to main? The C++ standard
> says main's linkage is implementation-defined, and I don't see how an
> extern main would be different from a non-extern main. (Please correct
> me if I'm wrong). If it doesn't have semantic value when applied to
> main, would it be best to be consistent in the fix-it and have it
> remove everything (or nothing) that's just semantic sugar?

Hm. Good question. It's too late to go into language lawyer mode to
decide whether extern on a function body has a semantic value. I leave
that to someone else to decide. If the answer is yes, reorder would be
nice though ("extern int main(){}", not "int extern main(){}").

Joerg



More information about the cfe-commits mailing list