From 73816e1adb25ad4cdfbd4f7dbd8aa65f73581174 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Nov 2022 15:09:22 -0800 Subject: [PATCH] configure: Fix clock_gettime() detection Prevent that the clock_gettime() and CLOCK_MONOTONIC tests fail as follows: error: argument 2 null where non-null expected [-Werror=nonnull] Signed-off-by: Bart Van Assche --- configure | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 30bf5acb..60b58cd2 100755 --- a/configure +++ b/configure @@ -1172,7 +1172,9 @@ cat > $TMPC << EOF #include int main(int argc, char **argv) { - return clock_gettime(0, NULL); + struct timespec ts; + + return clock_gettime(0, &ts); } EOF if compile_prog "" "" "clock_gettime"; then @@ -1194,7 +1196,9 @@ if test "$clock_gettime" = "yes" ; then #include int main(int argc, char **argv) { - return clock_gettime(CLOCK_MONOTONIC, NULL); + struct timespec ts; + + return clock_gettime(CLOCK_MONOTONIC, &ts); } EOF if compile_prog "" "$LIBS" "clock monotonic"; then -- 2.25.1