Why have xxx_t typedef names

Doug Gwyn gwyn at smoke.brl.mil
Fri Feb 15 08:06:01 AEST 1991


In article <3377 at unisoft.UUCP> greywolf at unisoft.UUCP (The Grey Wolf) writes:
>Is there/will there ever be a compile-time / cpp-time evaluation as to
>what types are defined?
>#if typed(stat_t)

No, because there ARE no types during preprocessing.

>There are many times I've wanted such a beast.

Lots of people would like it, too, but it would be a substantially
different language.  Keep this in mind when designing a new general-
purpose programming language.

>Also, do typedefs ever make it into an object's/executable's nlist?

Different object file formats have different support for this, but
note that a typedef does NOT define a new type, merely an identifier
that can be used to represent existing types.  Thus no "strong typing"
of such types is permitted, which limits its utility for debugging etc.



More information about the Comp.lang.c mailing list