fix: correct attribute, format specifiers, const qualifiers, and header guards - #76
Merged
Conversation
…er guards - nibble_to_ascii: __attribute__((const)) → __attribute__((pure)) since the function reads from a local array (memory beyond its arguments) - flash-ota.c: fix mixed %u/%d for int-typed fw_blocks and block vars, remove unnecessary (unsigned int) casts - Add missing #ifndef header guards to hexdump.h and version.h - Add const qualifier to prog parameter in all syntax() functions and socket_server() for consistency with other read-only string parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
nibble_to_ascii:__attribute__((const))→__attribute__((pure))— the function reads from a local array, which is memory beyond its arguments;constis too strict per GCC semanticsflash-ota.c: fix mixed%u/%dformat specifiers forint-typedfw_blocksandblockvariables, remove unnecessary(unsigned int)casts (3 sites)hexdump.h,version.h: add missing#ifndefheader guards (only two headers without them after prior modernization)syntax()functions +socket_server(): addconstqualifier tochar *prog/char *ifaceparameters for consistency with other read-only string parametersTest plan
make testpasses (24/24 tests)gcc -fsyntax-only -Wall -Wextraclean on non-libusb files