d-ronin / dRonin

The dRonin flight controller software.
http://dronin.org
Other
289 stars 167 forks source link

flight: *_t is reserved by POSIX #1948

Open tracernz opened 7 years ago

tracernz commented 7 years ago

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

mlyle commented 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?

tracernz commented 7 years ago

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.

mlyle commented 6 years ago

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)

glowtape commented 6 years ago

I like subsystem_whatever_t.

tracernz commented 6 years ago

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?

mlyle commented 6 years ago

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.