Michael Barr said:
In addition, I am sure there will be some comments on how the _STRUCTNAME identifier _STRUCTNAME reserved for implementation, so it is not recommended to use this form in any case.
OK, I play (but I need formatting so you get the answer):
The language standard is a contract between the compiler and the compiler, where each promises performs and does not perform certain actions.
Most identifiers starting with _ are reserved for implementation â including all identifiers starting with _ followed by an uppercase letter. This means that the compiler author is allowed to use them for any purpose, because the user compiler has promised not to use them.
Compilers - users who break their promise get strange results.
Conversely, all identifiers that the [applicable] standard does not reserve for implementation will be guaranteed to be available to the user compiler, since the author compiler promised not to use them.
Compiler authors who break their promise receive a refund when a valid code gets strange results.
My preference is to put trailing _ tags on tags, enable defenders, etc., so that I stay out of the implementation space; Thus:
typedef struct STRUCTNAME_ {
(Some purists frowned at typedef as just syntactic sugar, but C needs a little sugar here and there, otherwise it might seem pretty bland.)
mlp
source share