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

Remove STATIC_TESTABLE and STATIC_INLINE_TESTABLE wrappers #615

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

hanno-becker
Copy link
Contributor

STATIC_TESTABLE and STATIC_INLINE_TESTABLE were previously used as wrappers
around static and static inline that were defined as empty for a CBMC
build, thereby lifting visibility of static (inline) functions so that CBMC
would see them.

This commit achieves the same without STATIC_TESTABLE and
STATIC_INLINE_TESTABLE, both of which are removed, by defining static
and INLINE as the empty string in a CBMC build.

This allows overwriting `INLINE` through CFLAGS, which will be handy
e.g. for the CBMC build where both `static` and `inline` should be
ignored.

Signed-off-by: Hanno Becker <[email protected]>
@hanno-becker hanno-becker marked this pull request as ready for review January 6, 2025 04:20
@hanno-becker hanno-becker requested a review from a team as a code owner January 6, 2025 04:20
STATIC_TESTABLE and STATIC_INLINE_TESTABLE were previously used as wrappers
around `static` and `static inline` that were defined as empty for a CBMC
build, thereby lifting visibility of static (inline) functions so that CBMC
would see them.

This commit achieves the same without STATIC_TESTABLE and
STATIC_INLINE_TESTABLE, both of which are removed, by defining `static`
and `INLINE` as the empty string in a CBMC build.

Signed-off-by: Hanno Becker <[email protected]>
Copy link
Contributor

@mkannwischer mkannwischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice - I didn't know this works.
LGTM.

@hanno-becker hanno-becker merged commit 5658b37 into main Jan 6, 2025
104 checks passed
@hanno-becker hanno-becker deleted the no_static_testable branch January 6, 2025 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants