Skip to content

build: Ensure strchrnul() is available in header (fixes macOS build) #1660

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

Explorer09
Copy link
Contributor

The strchrnul() function is also introduced in macOS 15.4, however, for macOS build, a compiler may default to building for an older macOS version (such as 15.0). The configure script can wrongly assume the function may be used.

Fix the configure script's detection of strchrnul() by ensuring it's actually available through the header.

Fixes: #1659

@fasterit
Copy link
Member

fasterit commented Apr 5, 2025

Why don't you put the extra check into a darwin specific section and leave the rest as is for the 99.9%+ compiles on other platforms?

@Explorer09
Copy link
Contributor Author

@fasterit

Why don't you put the extra check into a darwin specific section and leave the rest as is for the 99.9%+ compiles on other platforms?

The strchrnul check is not specific to Darwin. The function was a GNU extension (glibc) but recently other OSes adopt the function as well.

@BenBE BenBE added enhancement Extension or improvement to existing feature build system 🔧 Affects the build system rather then the user experience MacOS 🍏 MacOS / Darwin related issues labels Apr 5, 2025
Copy link
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

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

Just a minor nitpick …

The strchrnul() function is also introduced in macOS 15.4, however, for
macOS build, a compiler may default to building for an older macOS
version (such as 15.0). The configure script can wrongly assume the
function may be used.

Fix the configure script's detection of strchrnul() by ensuring it's
actually available through the header.

Fixes: htop-dev#1659

Signed-off-by: Kang-Che Sung <[email protected]>
@BenBE BenBE added this to the 3.4.1 milestone Apr 7, 2025
@natoscott natoscott merged commit 28a62d7 into htop-dev:main Apr 8, 2025
19 checks passed
@Explorer09 Explorer09 deleted the strchrnul-darwin branch April 8, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system 🔧 Affects the build system rather then the user experience enhancement Extension or improvement to existing feature MacOS 🍏 MacOS / Darwin related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile warning with strchrnul in macOS 15.4
4 participants