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

Intentional Fallthrough? #8357

Open
r-barnes opened this issue Jun 24, 2024 · 1 comment
Open

Intentional Fallthrough? #8357

r-barnes opened this issue Jun 24, 2024 · 1 comment

Comments

@r-barnes
Copy link

Bug report

Is this fallthrough from B64_ENCODE_CONDITIONAL into B64_ENCODE intentional?

If so, can we mark it with __attribute__((fallthrough)); to facilitate enabling -Wimplicit-fallthrough?

What operating system and version are you using?

source code question

What version of osquery are you using?

master

What steps did you take to reproduce the issue?

What did you expect to see?

What did you see instead?

@Smjert
Copy link
Member

Smjert commented Jun 25, 2024

Hello @r-barnes, I would say it is intentional; the conditional_to_base64 function is documented here: https://osquery.readthedocs.io/en/latest/introduction/sql/#encoding-functions, and so it encodes to base64 only if the character is not printable (ASCII).

I think annotating it with fallthrough is sensible, I would use though the standard notation [[fallthrough]], which should be available since we are compiling with C++17 as the standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants