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

core/lib: define MAYBE_UNUSED #18884

Merged
merged 2 commits into from
Nov 22, 2022
Merged

Conversation

kfessel
Copy link
Contributor

@kfessel kfessel commented Nov 11, 2022

There are static functions and variables that may be unused if certain modules are used or not used.
Instead of adding a guard around these marking them as "maybe unused" is much clearer C23 seems to add a stadat attribute system where [[maybe_unused]] would be that mark

Contribution description

this adds aMAYBE_UNUSED define that uses the badly name __attribute((unused))__ to mark such maybe unused cases

Testing procedure

read

Issues/PRs references

this contains #18882

@kfessel kfessel requested a review from kaspar030 as a code owner November 11, 2022 13:10
@github-actions github-actions bot added the Area: core Area: RIOT kernel. Handle PRs marked with this with care! label Nov 11, 2022
@kfessel kfessel changed the title P macro maybe unused core/lib: define MAYBE_UNUSED Nov 11, 2022
jue89
jue89 previously requested changes Nov 11, 2022
core/lib/include/compiler_hints.h Show resolved Hide resolved
core/lib/include/compiler_hints.h Show resolved Hide resolved
@jue89
Copy link
Contributor

jue89 commented Nov 15, 2022

You may rebase on master ;-)

@kfessel kfessel force-pushed the p-macro-maybe-unused branch from 4d43fb4 to b4feefa Compare November 17, 2022 11:27
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 18, 2022
@riot-ci
Copy link

riot-ci commented Nov 18, 2022

Murdock results

✔️ PASSED

b4feefa core/lib: define MAYBE_UNUSED

Success Failures Total Runtime
117848 0 117848 02h:29m:53s

Artifacts

@benpicco benpicco merged commit 0621150 into RIOT-OS:master Nov 22, 2022
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants