Skip to content

sys/checksum: add ACCESS() attribute#22381

Open
maribu wants to merge 1 commit into
RIOT-OS:masterfrom
maribu:sys/checksum
Open

sys/checksum: add ACCESS() attribute#22381
maribu wants to merge 1 commit into
RIOT-OS:masterfrom
maribu:sys/checksum

Conversation

@maribu

@maribu maribu commented Jun 14, 2026

Copy link
Copy Markdown
Member

Contribution description

Annotated a functions in sys/checksum with the access attribute using the ACCESS() macro to allow GCC to perform better -Wstringop-overflow diagnostics.

Testing procedure

The Ci should do the testing here

Issues/PRs references

#22380

Declaration of AI-Tools / LLMs usage:

Same as in #22380

@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jun 14, 2026
@github-actions github-actions Bot added the Area: sys Area: System label Jun 14, 2026
@riot-ci

riot-ci commented Jun 14, 2026

Copy link
Copy Markdown

Murdock results

FAILED

d90872f sys/checksum: add ACCESS() attribute

Success Failures Total Runtime
656 0 10168 01m:36s

Artifacts

Comment thread sys/include/checksum/crc16_ccitt.h Outdated

@mguetschow mguetschow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM then!

@maribu maribu added the AI: Helped PR/Issue uses AI sparingly, e.g. code inline assistant, debugging with AI, etc. label Jul 6, 2026
Comment thread sys/checksum/fletcher32.c
}

void fletcher32_update(fletcher32_ctx_t *ctx, const void *data, size_t words)
void fletcher32_update(fletcher32_ctx_t *ctx, const uint16_t *data, size_t words)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does that count as "API change"? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Technically yes.

Using this function correctly already required data to be aligned to uint16_t and words be the size in number of uint16_t. Failing to do so could cause bus errors (unaligned access) or out of bounds access.

Now instead of runtime failures, uncorrect use would fail at compile time.

@crasbe crasbe added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 7, 2026
Annotated a functions in `sys/checksum` with the `access` attribute
using the `ACCESS()` macro to allow GCC to perform better
`-Wstringop-overflow` diagnostics.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Helped PR/Issue uses AI sparingly, e.g. code inline assistant, debugging with AI, etc. Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants