Skip to content

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 <explorer09@gmail.com>
@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