]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: pacify GCC 14 -Wmissing-variable-declarations wrt md5.h
authorPádraig Brady <P@draigBrady.com>
Wed, 1 May 2024 13:15:28 +0000 (14:15 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 1 May 2024 13:32:26 +0000 (14:32 +0100)
* src/sort.c: Use pragmas to avoid warnings with our
openssl adjustment and to minimize coupling with openssl.

src/sort.c

index 78983ff275b55f898fd76256b06ba358b452ea04..32e4c73a2fe867479a58561867e7adca3d7e21da 100644 (file)
@@ -2092,6 +2092,12 @@ getmonth (char const *month, char **ea)
    trick md5.h into declaring and using pointers to functions not functions.
    This causes the compiler's -lcrypto option to have no effect,
    as sort.o no longer uses any crypto symbols statically.  */
+
+# if 4 < __GNUC__ + (8 <= __GNUC_MINOR__)
+  /* Pacify gcc -Wmissing-variable-declarations through at least GCC 14.  */
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
+# endif
 # define MD5_Init (*ptr_MD5_Init)
 # define MD5_Update (*ptr_MD5_Update)
 # define MD5_Final (*ptr_MD5_Final)
@@ -2131,6 +2137,9 @@ link_libcrypto (void)
   ptr_MD5_Init = symbol_address (handle, "MD5_Init");
   ptr_MD5_Update = symbol_address (handle, "MD5_Update");
   ptr_MD5_Final = symbol_address (handle, "MD5_Final");
+# if 4 < __GNUC__ + (8 <= __GNUC_MINOR__)
+#  pragma GCC diagnostic pop
+# endif
 #endif
 }