Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flight: *_t is reserved by POSIX #1948

Open
tracernz opened this issue Sep 21, 2017 · 6 comments
Open

flight: *_t is reserved by POSIX #1948

tracernz opened this issue Sep 21, 2017 · 6 comments

Comments

@tracernz
Copy link
Member

tracernz commented Sep 21, 2017

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

@tracernz tracernz added this to the Wired milestone Sep 21, 2017
@mlyle
Copy link
Member

mlyle commented Sep 21, 2017

:/ 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
Copy link
Member Author

tracernz commented Sep 21, 2017

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.

@tracernz tracernz modified the milestones: Wired, Post-Wired Jan 24, 2018
@mlyle
Copy link
Member

mlyle commented Mar 18, 2018

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
Copy link
Member

I like subsystem_whatever_t.

@tracernz
Copy link
Member Author

tracernz commented Mar 18, 2018

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
Copy link
Member

mlyle commented Mar 18, 2018

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.

@mlyle mlyle modified the milestones: Inconceivable, Ludicrous Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants