It defaults to an int
.
The compiler warning shows what is going on:
#1 with x86-64 gcc 8.2
<source>:1:9: warning: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
typedef t;
From C99 onwards, the implicit int
rule was removed. So this is not applicable from C99 onward.
If you use the -pedantic-errors
compiler option in GCC (meaning strict conformity to the standard), it issues an error. See here.
If you are interested, the relevant section in C89 standard which allowed this:
3.5.2 Type specifiers
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.
- void
- char
- signed char
- unsigned char
- short , signed short , short int , or signed short int
- unsigned short , or unsigned short int
- int , signed , signed int , or no type specifiers
So in C99, the last part of what was bolded above (or no type specifiers) was removed.