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

Ryan Gerleve aikavanak at gmail.com
Wed Mar 16 19:39:31 PDT 2011


On Wed, Mar 16, 2011 at 8:42 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Wed, Mar 16, 2011 at 08:37:09PM -0500, Ryan Gerleve wrote:
>> signed long main() {}
>>
>> Here, there are multiple fixits that could result in a correct program.
>> 1. Remove 'long',
>> 2. Replace 'long' with 'int', or
>> 3. Replace 'signed long' with 'int'.
>
> Go with (3). IMO there is exactly one situation when signed has actual
> semantic value and that's in combination with char. Otherwise it is just
> syntactic sugar.
>
> Joerg

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?



More information about the cfe-commits mailing list