Skip to content

sys/base64: add ACCESS() attribute#22369

Open
maribu wants to merge 1 commit into
RIOT-OS:masterfrom
maribu:sys/base64/add-access-attribute
Open

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

Conversation

@maribu

@maribu maribu commented Jun 10, 2026

Copy link
Copy Markdown
Member

Contribution description

  • annotate functions using the ACCESS() macro with the access attribute so that GCC can emit proper -Wstringop-overflow warnings
  • use SPDX license IDs

Testing procedure

The CI will do this

Issues/PRs references

#22368

Declaration of AI-Tools / LLMs usage:

Same as in #22368

@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 10, 2026
@github-actions github-actions Bot added the Area: sys Area: System label Jun 10, 2026
@riot-ci

riot-ci commented Jun 10, 2026

Copy link
Copy Markdown

Murdock results

✔️ PASSED

186d47a sys/base64: add ACCESS() attribute

Success Failures Total Runtime
11123 0 11124 11m:28s

Artifacts

@maribu maribu force-pushed the sys/base64/add-access-attribute branch from d9b43ca to 283a304 Compare June 10, 2026 19:26
Comment thread sys/include/base64.h Outdated
Comment thread sys/include/base64.h Outdated
- annotate functions using the `ACCESS()` macro with the `access`
  attribute so that GCC can emit proper `-Wstringop-overflow` warnings
- use SPDX license IDs

Co-authored-by: crasbe <crasbe@gmail.com>
@maribu maribu force-pushed the sys/base64/add-access-attribute branch from 2285973 to 186d47a Compare June 10, 2026 20:26
Comment thread sys/include/base64.h
Comment on lines +73 to 75
ACCESS(read_only, 1, 2)
int base64_encode(const void *data_in, size_t data_in_size,
void *base64_out, size_t *base64_out_size);

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.

This

Suggested change
ACCESS(read_only, 1, 2)
int base64_encode(const void *data_in, size_t data_in_size,
void *base64_out, size_t *base64_out_size);
ACCESS(read_only, 1, 2)
ACCESS(write_only, 3, 4)
int base64_encode(const void *data_in, size_t data_in_size,
void *base64_out, size_t *base64_out_size);

is not possible because base64_out_size is a pointer, right? A shame.

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.

Indeed. The attribute is pretty limited in what it can express :/

We could change the API to take a size_t for the buffer size and return an ssize_t for how much was actually written. But I'm not sure if it is worth an API change.

@maribu maribu added the AI: Helped PR/Issue uses AI sparingly, e.g. code inline assistant, debugging with AI, etc. label Jul 6, 2026
@crasbe crasbe added the State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary label Jul 7, 2026
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 State: needs rebase State: The codebase was changed since the creation of the PR, making a rebase necessary 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