Skip to content

Static Functions in Headers? #166

Open
@insertinterestingnamehere

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions