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

Ryan Gerleve aikavanak at gmail.com
Wed Mar 16 20:01:06 PDT 2011


On Wed, Mar 16, 2011 at 9:45 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> 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

Alright, that's fair. But while I prefer "extern int" over "int
extern" also, should a fixit really be suggesting a coding style to
the user, as opposed to trying to match what he or she already typed?



More information about the cfe-commits mailing list