nrk said:
I was under the impression that implicit int deprecation applied to
functions without return type, and variable declarations with no type
specified. Does it also apply to declarations along the lines of:
long i;
short i;
??? That, I would find quite annoying.
I certainly hope not, and my impression is the same as yours - that it
applies to declarations with no type specified. If Old Wolf was
referring to changes in the C99 standard, then I think "implicit int" in
cases like this is safe. C99 considers 'long', 'short', 'unsigned', etc.
to be type specifiers all by themselves. Unlike C89, it requires that at
least one type specifier be present in a declaration.
From C89:
3.5.2 Type specifiers
Syntax
type-specifier:
void
char
short
int
long
float
double
signed
unsigned
struct-or-union-specifier
enum-specifier
typedef-name
Constraints
Each list of type specifiers shall be one of the following sets; the
type specifiers may occur in any order, possibly intermixed with the
other declaration specifiers.
* int , signed , signed int , or no type specifiers
<remainder of list snipped>
And from C99:
6.7.2 Type specifiers
Syntax
[#1]
type-specifier:
void
char
short
int
long
float
double
signed
unsigned
_Bool
_Complex
_Imaginary
struct-or-union-specifier
enum-specifier
typedef-name
Constraints
[#2] At least one type specifier shall be given in the
declaration specifiers in each declaration, and in the
specifier-qualifier list in each struct declaration and type
name. Each list of type specifiers shall be one of the
following sets (delimited by commas, when there is more than
one set on a line); the type specifiers may occur in any
order, possibly intermixed with the other declaration
specifiers.
<list snipped, but it does not contain anything allowing
the type specifier to be omitted.>
-Kevin