From: Roy Marples Date: Sun, 8 Jan 2023 22:10:21 +0000 (+0000) Subject: configure: Ensure that we use the return of the functions we test X-Git-Tag: v10.0.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdcf878fffd0a265651c16dc4c98048352e54a85;p=thirdparty%2Fdhcpcd.git configure: Ensure that we use the return of the functions we test As newer compiler defaults warn if they are not used. Should fix #163. --- diff --git a/configure b/configure index daee6df9..fd4c8a4a 100755 --- a/configure +++ b/configure @@ -848,8 +848,7 @@ if [ -z "$ARC4RANDOM" ]; then cat <_arc4random.c #include int main(void) { - arc4random(); - return 0; + return (int)arc4random(); } EOF if $XCC _arc4random.c -o _arc4random 2>&3; then @@ -870,8 +869,7 @@ if [ -z "$ARC4RANDOM_UNIFORM" ]; then cat <_arc4random_uniform.c #include int main(void) { - arc4random_uniform(100); - return 0; + return (int)arc4random_uniform(100); } EOF if $XCC _arc4random_uniform.c -o _arc4random_uniform 2>&3; then @@ -915,8 +913,7 @@ if [ -z "$PIDFILE_LOCK" ]; then #include #include int main(void) { - pidfile_lock(NULL); - return 0; + return (int)pidfile_lock(NULL); } EOF # We only want to link to libutil if it exists in /lib @@ -985,8 +982,7 @@ if [ -z "$STRLCPY" ]; then int main(void) { const char s1[] = "foo"; char s2[10]; - strlcpy(s2, s1, sizeof(s2)); - return 0; + return (int)strlcpy(s2, s1, sizeof(s2)); } EOF if $XCC _strlcpy.c -o _strlcpy 2>&3; then @@ -1010,8 +1006,7 @@ if [ -z "$STRTOI" ]; then #include int main(void) { int e; - strtoi("1234", NULL, 0, 0, INT32_MAX, &e); - return 0; + return (int)strtoi("1234", NULL, 0, 0, INT32_MAX, &e); } EOF if $XCC _strtoi.c -o _strtoi 2>&3; then @@ -1266,8 +1261,7 @@ if [ -z "$POLL" ]; then #include #include int main(void) { - pselect(0, NULL, NULL, NULL, NULL, NULL); - return 0; + return pselect(0, NULL, NULL, NULL, NULL, NULL); } EOF if $XCC _pselect.c -o _pselect 2>&3; then @@ -1503,8 +1497,7 @@ if [ -z "$HMAC" ]; then #include #include int main(void) { - hmac(NULL, NULL, 0, NULL, 0, NULL, 0); - return 0; + return (int)hmac(NULL, NULL, 0, NULL, 0, NULL, 0); } EOF if $XCC _hmac.c $MD5_LIB -o _hmac 2>&3; then @@ -1516,8 +1509,7 @@ EOF cat <_hmac.c #include int main(void) { - hmac(NULL, NULL, 0, NULL, 0, NULL, 0); - return 0; + return (int)hmac(NULL, NULL, 0, NULL, 0, NULL, 0); } EOF if $XCC _hmac.c $MD5_LIB -o _hmac 2>&3; then @@ -1589,8 +1581,7 @@ if [ "$DEV" != no ] && [ "$UDEV" != no ] && [ -n "$LIBUDEV_LIBS" ]; then #include #include int main(void) { - udev_monitor_filter_add_match_subsystem_devtype(NULL, NULL, NULL); - return 0; + return udev_monitor_filter_add_match_subsystem_devtype(NULL, NULL, NULL); } EOF if $XCC $LIBUDEV_CFLAGS _udev.c -o _udev $LIBUDEV_LIBS 2>&3 @@ -1607,8 +1598,7 @@ EOF #include #include int main(void) { - udev_device_get_is_initialized(NULL); - return 0; + return udev_device_get_is_initialized(NULL); } EOF if $XCC $LIBUDEV_CFLAGS _udev.c -o _udev $LIBUDEV_LIBS 2>&3