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

Static Functions in Headers? #166

Open
insertinterestingnamehere opened this issue Nov 1, 2023 · 0 comments
Open

Static Functions in Headers? #166

insertinterestingnamehere opened this issue Nov 1, 2023 · 0 comments

Comments

@insertinterestingnamehere
Copy link
Collaborator

I'm seeing various static functions defined in headers. Offhand this seems like a mistake since the primary reason for to make something static is to either produce a unique copy per translation unit and to restrict visibility to that translation unit. Symbol visibility appears to be completely ad-hoc at the moment, and these functions have no associated static state that would need to be duplicated. Perhaps inline was intended instead?

Various examples (for now) in:
https://github.com/sandialabs/qthreads/blob/main/src/affinity/shepcomp.h
https://github.com/sandialabs/qthreads/blob/main/src/affinity/shufflesheps.h

For now, to bypass warnings about unused static functions, I'm marking some of them as extern inline. If we switch the default symbol visibility to hidden (as suggested in #165) then we should be able to just mark them as inline.

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

1 participant