When should _t be used? Never? It is reserved by the main standard (POSIX), and even if it is not, your code may someday be used in a POSIX environment, so using _t is a bad idea.
I would like to further say that overuse of typedef bad overall. If your type is struct , union or enum , use these keywords when you declare variables, and this makes your code more understandable. The use of typedef best reserved to make the underlying type invisible for abstraction / encapsulation purposes. Some great examples from the C standard: size_t , int32_t , mbstate_t and stdio FILE .
Some of the worst abuses of typedef relate to the Windows API ( WORD , DWORD , INT , LPSTR , etc.) and glib ( gint , gchar , etc.). Creating duplicates of standard C types with the same intended use is just confusing and serves to block developers in your library / platform, polluting all the code with these non-standard type names.
R .. Jul 12 '10 at 8:12 2010-07-12 08:12
source share