>>106935409
>not having to type struct everywhere.
That's a GOOD thing.
Look at this code. Can you tell what this outputs without looking at the type definitions?
int main(void)
{
point1 p1;
point2 p2;
p1.x = 3;
p1.y = 4;
printf("%d %f\n", p1.x, p1.y);
p2.x = 3;
p2.y = 4;
printf("%d %f\n", p2.x, p2.y);
}
Solution: no. The reason is that "point1" is actually a typedef for "union point1" and "point2" typedefs "struct point2". Accessing members of a struct and a union has radically different consequences and this should be explicit in the type definition. Besides, struct and union tags don't pollute the variable namespace, which is nice.
Typedefs ONLY make sense for completely opaque types (think FILE), where client code does not and doesn't have to care what the object actually IS underneath. But anything whose members are intended to be accessed directly should never be a typedef, precisely for this reaosn.
C++ probably introduced an automatic typedef to encourage OOP, where you barely ever access members directly, but the way C++ does OOP is trash anyway so it's not worth bothering.
>>106935760
Typedef'ing non-function pointers should be a criminal offense. It buys you absolutely nothing and only obfuscates code.