-
-
Notifications
You must be signed in to change notification settings - Fork 480
Compile warning with strchrnul in macOS 15.4 #1659
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
Comments
As some systems don't have it, we could fall back to use our internal implementation in that case. Mind to write a quick PR? |
@BenBE I was asking for some ideas for the fix before I try to make one for me. This compatibility problem sounds like a new one (and it's macOS exclusive) It's because macOS 15.4 (Sequoia) does ship with For me, there are two changes needed here:
|
The changes for The important part of that diff is the following section: diff --git a/configure.ac b/configure.ac
index e2d8ca9f1a0d8dc0db3767c11105fa0879cdba24..e7cd4de01639d42404ba54088ad01b461eb2ef96 100644 (file)
--- a/configure.ac
+++ b/configure.ac
@@ -1809,7 +1809,6 @@ AC_CHECK_FUNCS(m4_normalize([
pthread_is_threaded_np
setproctitle
setproctitle_fast
- strchrnul
strsignal
syncfs
sync_file_range
@@ -1849,6 +1848,7 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
# won't handle deployment target restrictions on macOS
AC_CHECK_DECLS([preadv], [], [AC_LIBOBJ(preadv)], [#include <sys/uio.h>])
AC_CHECK_DECLS([pwritev], [], [AC_LIBOBJ(pwritev)], [#include <sys/uio.h>])
+AC_CHECK_DECLS([strchrnul], [], [], [#include <string.h>])
# This is probably only present on macOS, but may as well check always
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>]) |
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]>
I think I'll leave out the second suggested change as it's more of a usability feature than a necessary bug fix. The /* Default value for macOS SDK in macOS Sequoia (15.x) */
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 150000
/* If -mmacos-version-min=15.1 is specified in CFLAGS */
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 150100 |
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]>
And we are not alone in encountering this warning.
sqlc-dev/sqlc#3916
https://www.postgresql.org/message-id/E1tziZ6-002AW9-2C%40gemulon.postgresql.org
The text was updated successfully, but these errors were encountered: