Mike Williams wrote:
> [asbestos suit donned? check!]
>
> The style(9) man page contains the statement
>
> Don't use the same name for a struct tag and a typedef, as this makes
> the code unusable from C++.
>
> My question is how does this make the code unusable from C++?
>
> An interweb search doesn't turn up any examples or explanations, just
> the usual explanations of why you need typedef in C but not in C++.
> While I know C the subtleties of C++ are beyond me. The only detailed
> references seem to be historic variations on the BSD style page.
>
> Not one to take inscriptions on a tablet without question, it would be
> nice to understand the reason for this statement.
>
If I understand you correctly you'd like to do something like:
typedef struct some_type some_type;
AFAICT when a struct is defined in C++, e.g.:
struct some_type {
...
};
variables can be declared as, either:
struct some_type some_var;
or:
some_type some_var;
So 'some_type' is already sort of an implicit typedef of 'struct some_type'.