S
sandeep
Here is a declaration:
int volati;
Am I right to think that for the previous ISO Standard (C89) this is an
undefined behavior, but not in the current Standard (C99)? My reasoning
is that a C89 compiler is allowed to treat only the first 6 characters of
any name as significant, so this could be equivalent to
int volatile;
which is a syntax error (Constraint Violation). In C99 the whole name is
significant.
It is interesting in gcc: int volati; compiles fine (not even a
diagnostic), while int volatile; also compiles (should be a syntax error)
but with a message,
warning: useless type name in empty declaration
int volati;
Am I right to think that for the previous ISO Standard (C89) this is an
undefined behavior, but not in the current Standard (C99)? My reasoning
is that a C89 compiler is allowed to treat only the first 6 characters of
any name as significant, so this could be equivalent to
int volatile;
which is a syntax error (Constraint Violation). In C99 the whole name is
significant.
It is interesting in gcc: int volati; compiles fine (not even a
diagnostic), while int volatile; also compiles (should be a syntax error)
but with a message,
warning: useless type name in empty declaration