TypeDef array of size 1



Hello friends,

It seems to be quite common in libraries (e.g. GMP) to have typedefs
like

typedef struct {
/* stuff */
} __type_struct;
typedef __type_struct type_t[1];

I guess the advantage of this is that it allows type_t variables to be
passed by reference without an extra level of indirection.

Is this considered good C style? Are there any problems or pitfalls to
be wary of with this approach?

.



Relevant Pages