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

[Core] Ensure inline toupper/tolower #1805

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

sebaszm
Copy link
Contributor

@sebaszm sebaszm commented Dec 5, 2024

Some standard lib headers (e.g. stdlib.h) end up setting __NO_CTYPE. When ctype.h is processed with this flag different code is compiled, amongst others making toupper/tolower and some isxxx() not inline but calling extern functions (which is slower). Because of include guards to ensure the inlining, ctype.h must be the first header file included for a module.

Some standard lib headers (e.g. stdlib.h) end up setting __NO_CTYPE.
When ctype.h is processed with this flag different code is compiled,
amongst others making toupper/tolower and some isxxx() not inline
but calling extern functions (which is slower). Because of include
guards to ensure the inlining, ctype.h must be the first header file
included for a module.
@sebaszm sebaszm requested a review from pwielders December 5, 2024 23:34
@sebaszm
Copy link
Contributor Author

sebaszm commented Dec 5, 2024

This behaviour is a potential libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100128

@pwielders pwielders merged commit 50273c5 into master Dec 6, 2024
75 checks passed
@sebaszm sebaszm deleted the development/inline-tolower branch December 8, 2024 20:12
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.

2 participants