Local type inference with auto is in C2X
Florian Weimer
fweimer@redhat.com
Thu Nov 3 18:33:15 GMT 2022
* Joseph Myers:
> On Thu, 3 Nov 2022, Florian Weimer via Gcc wrote:
>
>> My main worry is that both Clang and GCC still enable implicit ints by
>> default. This means that auto variables have type int always, and that
>> can subtly alter the meaning of programs. The only indication that this
>> has happened in a code base is a warning that went away (!). I don't
>> like that.
>
> My expectation is that the old use of auto as a storage class specifier is
> actually very rare in C code, so this particular sub-case (auto with no
> type specifier meaning implicit int) is even rarer and there isn't much
> porting to be done for it (unlike for the rest of implicit int).
Hmm, that's certainly a reassuring perspective. Maybe I'm worrying
about nothing after all.
Thanks,
Florian
More information about the Gcc
mailing list