typedef in C just make an alias to the same type. structs have nominal typing though:
// this typedef is optional to avoid having to refer to the struct tag when referencing the typestypedefstruct {int} t_0;
typedefstruct {long} t_1;
t_0 test() {
t_1 foo = {1};
return foo; // error
}
typedef
in C just make an alias to the same type.struct
s have nominal typing though:// this typedef is optional to avoid having to refer to the struct tag when referencing the types typedef struct {int} t_0; typedef struct {long} t_1; t_0 test() { t_1 foo = {1}; return foo; // error }