debug: Declare as printf-style, remove empty statement #1951
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.