Skip to content

gnu.cfg: Add __builtin_ctz - #8721

Open
kronus-ed wants to merge 1 commit into
cppcheck-opensource:mainfrom
kronus-ed:gnu-cfg-builtin-ctz
Open

gnu.cfg: Add __builtin_ctz#8721
kronus-ed wants to merge 1 commit into
cppcheck-opensource:mainfrom
kronus-ed:gnu-cfg-builtin-ctz

Conversation

@kronus-ed

Copy link
Copy Markdown

__builtin_ctzl, and __builtin_ctzll trailing zero count functions.
@chrchr-github

Copy link
Copy Markdown
Collaborator

Thanks for your contribution. Can those functions be pure?

@aadanen

aadanen commented Sep 8, 2026

Copy link
Copy Markdown

I don't see __builtin_ctz at that link. I instead found it here: https://gcc.gnu.org/onlinedocs/gcc/Bit-Operation-Builtins.html, which has several other similar functions that could be added as well. I also found a file in gcc that gives the ctz builtin ATTR_CONST_NOTHROW_LEAF_LIST so it is pure/const as expected of a bit fiddling function. I will look into making a more general PR for all these builtins.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants