]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
#ifdef out unused put_ieee754() which triggers a warning and appears buggy.
authorDave Hart <hart@ntp.org>
Wed, 31 Jan 2024 20:47:13 +0000 (20:47 +0000)
committerDave Hart <hart@ntp.org>
Wed, 31 Jan 2024 20:47:13 +0000 (20:47 +0000)
Insert newlines in long error messages in ntp_openssl.m4, ntp_crypto_rand.m4.

bk: 65bab1d1-GrziZe9ubEP6pYabVw18Q

libparse/ieee754io.c
sntp/m4/ntp_crypto_rand.m4
sntp/m4/ntp_openssl.m4

index 6f6fb0d822f3fedb6d9b34847f72d8a7a0c932d1..f2c48916ac700a4246a7b30f53741cfdd40351ff 100644 (file)
@@ -394,7 +394,22 @@ fetch_ieee754(
        }
     }
 }
-  
+
+/*
+ * DLH: This function is currently unused in ntpd.  If you think about
+ * using it, be sure it does what you intend.  I notice the bufpp arg
+ * is never referenced, and the calculated mantissa_high & mantissa_low
+ * are only referenced in debug output.  It seems they're supposed to
+ * be composed into an ieee754-format float and stored at *bufpp or
+ * possibly **bufpp.  Brought to my attention by this:
+ *
+ * ieee754io.c:414:10: warning: variable 'mantissa_low' set but not used
+ * [-Wunused-but-set-variable]
+ *
+ * To quiet it I'm #ifdef'ing the function away for now, here and below
+ * the call to it in main().
+ */
+#ifdef PUT_IEEE754_UNUSED_FUNC
 int
 put_ieee754(
            unsigned char **bufpp,
@@ -534,6 +549,7 @@ put_ieee754(
     }
   return IEEE_OK;
 }
+#endif /* */PUT_IEEE754_UNUSED_FUNC */
 
 
 #if defined(DEBUG) && defined(LIBDEBUG)
@@ -560,8 +576,11 @@ int main(
   printf("fetch from %f = %d\n", f, fetch_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off));
   printf("fp [%s %s] = %s\n", fmt_blong(fp.l_ui, 32), fmt_blong(fp.l_uf, 32), mfptoa(fp.l_ui, fp.l_uf, 15));
   f_p = &f;
+#ifdef PUT_IEEE754_UNUSED_FUNC
   put_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off);
-  
+/* there should be a check on *f_p (f) having the expected result here */
+#endif /* */PUT_IEEE754_UNUSED_FUNC */
+
   return 0;
 }
 
index 0341e38451151f26688ea84bc202a173fc7c9846..391f1cbd5992e6e0aa97413c9d21659ceb286e04 100644 (file)
@@ -53,19 +53,20 @@ case "$ntp_openssl$ntp_use_openssl_random$ac_cv_func_RAND_bytes$ac_cv_func_RAND_
     AC_MSG_NOTICE([SSL library's secure random number generator unavailable.])
     case "$ntp_ssl_random_mandatory" in
      yes)
-       AC_MSG_FAILURE(
-           [No suiteable SSL library was found and ]
-           [--enable-openssl-random was given..  Remove ]
-           [--enable-openssl-random if you wish to build without a ]
-           [cryptographically secure RNG.  ]
-           [WARNING: Use of ntp-keygen without a secure RNG may generate ]
-           [keys that are predictable.]
+       AC_MSG_ERROR(
+[No suitable SSL library was found and
+--enable-openssl-random was given..  Remove --enable-openssl-random
+if you wish to build without a cryptographically secure random number
+generator.
+
+WARNING: Use of ntp-keygen without a secure RNG may generate
+-------  keys that are predictable.]
        )
        ;;
      *)
        AC_MSG_WARN(
-           [WARNING: Use of ntp-keygen without a secure RNG may generate ]
-           [keys that are predictable.]
+[WARNING: Use of ntp-keygen without a secure RNG may generate
+-------  keys that are predictable.]
        )
     esac
 esac
index 6718b6dd63d2b91953cd3e9f0b810ba991c93554..74ffb5ad9014a5dc86d0e4a7210deb1136c0d6f1 100644 (file)
@@ -225,10 +225,13 @@ case "$with_crypto" in
        LIBS="$NTPSSL_SAVED_LIBS"
        case "$ntp_ssl_libdir" in
         not_found)
-           AC_MSG_ERROR([You may want to use --without-crypto, or]
-                        [ add openssl.pc/libcrypto.pc to PKG_CONFIG_PATH,]
-                        [ or use the --with-openssl-libdir=/some/path option to configure:]
-                        [ libcrypto not found in $ntp_ssl_libdir_search.])
+           AC_MSG_ERROR(
+[You may want to use --without-crypto, or add 
+openssl.pc/libcrypto.pc to PKG_CONFIG_PATH, or use the 
+--with-openssl-libdir=/some/path option to configure.
+libcrypto not found in any of the following directories:
+$ntp_ssl_libdir_search]
+           )
        esac
        AC_MSG_NOTICE([libcrypto found in $ntp_ssl_libdir])
     esac
@@ -245,8 +248,8 @@ case "$with_crypto" in
     esac
     case "$ntp_ssl_incdir" in
      'not needed')
-           ntp_ssl_incdir_search="$ntp_ssl_incdir"
-           ;;
+       ntp_ssl_incdir_search="$ntp_ssl_incdir"
+       ;;
      *)
        AC_MSG_NOTICE([Searching for openssl include directory])
        case "$with_openssl_incdir" in
@@ -283,10 +286,13 @@ case "$with_crypto" in
            CPPFLAGS="$NTPSSL_SAVED_CPPFLAGS"
            case "$ntp_ssl_incdir" in
             '')
-               AC_MSG_ERROR([You may want to use --without-crypto, or]
-                            [ add openssl.pc/libcrypto.pc to PKG_CONFIG_PATH,]
-                            [ or use the --with-openssl-incdir=/some/path option to configure:]
-                            [ usable openssl/evp.h not found in $ntp_ssl_incdir_search.])
+               AC_MSG_ERROR(
+[You may want to use --without-crypto, or add
+openssl.pc/libcrypto.pc to PKG_CONFIG_PATH, or use the
+-with-openssl-incdir=/some/path option to configure.
+No usable openssl/evp.h found in any of the following direcotries:
+$ntp_ssl_incdir_search]
+               )
            esac
            ntp_ssl_cppflags="-I$ntp_ssl_incdir"
            AC_MSG_NOTICE([Found evp.h in $ntp_ssl_incdir/openssl])
@@ -379,9 +385,10 @@ case "$ntp_openssl:$ntp_ssl_libdir" in
            case "$build:$ntp_cv_ssl_needs_dashR" in
             $host:no)
                AC_MSG_FAILURE(
-                   [Unable to run program using crypto, check openssl.pc or]
-                   [ libcrypto.pc are in PKG_CONFIG_PATH, or provide]
-                   [ --with-openssl-libdir=/some/path])
+[Unable to run program using crypto, check openssl.pc
+or libcrypto.pc are in PKG_CONFIG_PATH, or provide the
+ --with-openssl-libdir=/some/path option to configure.]
+               )
            esac
        esac
     esac