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

debug: Declare as printf-style, remove empty statement #1951

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Dec 30, 2024

This resolves the -Wformat-nonliteral warning by (which complains about non-literals used as printf formatters, unless the containing function itself is also printf style), and a stray leftover empty debug statement discovered by that warning: -Wformat-nonliteral is a bit of a false postive here because due to the level prefix, the empty printf is not really empty, but it is accurate enough in that it does not provide any valuable details.


This was found when building the latest nimble with RIOT, which has relatively strict warnings on – and while those are often disabled for projects that don't usually build with the strict warnings, since the debug header gets included in public headers, it spreads to many compilation units. Applying the attribute(format) is also in line with RIOT's code style, which while not directly applicable, is tangentially relevant as the header file is specifically part of the RIOT port.

If there is actual information that should be shown in the removed DEBUG line, I'm happy to alter the patch to include it.

This resolves the -Wformat-nonliteral warning by (which complains about
non-literals used as printf formatters, unless the containing function
itself is also printf style), and a stray leftover empty debug statement
discovered by that warning: -Wformat-nonliteral is a bit of a false
postive here because due to the level prefix, the empty printf is not
*really* empty, but it is accurate enough in that it does not provide
any valuable details.
@github-actions github-actions bot added host size/XS Extra small PR labels Dec 30, 2024
@sjanc sjanc merged commit 734a53d into apache:master Jan 3, 2025
19 checks passed
@chrysn chrysn deleted the riot-printf branch January 4, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host size/XS Extra small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants