No. The keyword is not useful.
And it's high time the committee did something about that, too. Quick,
someone invent a new use for "auto".
Actually, Keith mentioned implicit int, which is still allowed in C89.
Isn't the following a conforming C89 program where the presence of the
auto keyword has an effect?
#include <stdio.h>
int main(void)
{
int i;
i = 1;
{
/* Because auto makes this an implicit-int declaration, this is
a no-op. */
auto i = 0;
}
printf("auto did%s have an effect\n", i? "" : " not");
return EXIT_SUCCESS;
}
Without the "auto", "i = 0" would have changed the value of i rather
than declaring a new variable in the inner scope. However, I realize
that's not exactly a case of auto being "legal, but not default" -
it's just auto being used as shorthand for "auto int", in which the
"auto" is still redundant. Whether this makes "auto" "useful" is a
matter of definition (it does something, but not anything that
wouldn't be achieved with "int"). Certainly it's not very useful;
it's just a contrived case where removing all instances of the auto
keyword from the source would change the program's semantics.