Open tracernz opened 7 years ago
:/ this is one of those things that's technically true, but every project and coding standard violates-- I just grepped a dozen source trees including Linux, GCC, flightgear, Eigen, etc, and found it used as a preferred suffix for type names in each Can't we live with it?
I think we can live with it but should avoid it without pios_
prefix? IOW <relatively generic name>_t
is a recipe for problems, but pios_<whatever>_t
is quite safe.
What do you think, add to style guide to generally avoid-- pios_whatever_t or in libraries subsystem_whatever_t ... and close this out? (And add no new violators)
I like subsystem_whatever_t.
Why do we need the _t suffix? Doesn't add any useful information AFAICT? It just exists to allow stdint.h etc. to avoid collisions with user types that existed first?
No, _t predates stdint, etc. It meant "type"-- it puts things into a different namespace from identifiers, makes things easy to grep for, etc. Now the OS is kinda claiming it and some people agree, some people don't.
It has been used a bit recently in flight code. We should probably avoid it to keep away from potential clashes in future. Should be fine with pios_ prefix though (even if not strictly ok).
Relates #1947