]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
sort: better -Wmissing-variable-declarations
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 May 2024 04:09:28 +0000 (21:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 May 2024 06:09:32 +0000 (23:09 -0700)
* src/sort.c: Ignore -Wmissing-variable-declarations only
with GCC 14 and newer, since it didn’t exist earlier.
Ignore the warning only when including md5.h, where it
needs to be ignored, as the warning might be useful elsewhere.

src/sort.c

index 32e4c73a2fe867479a58561867e7adca3d7e21da..6c273fab994ecd48d080fe862b68ab84ec9f57f7 100644 (file)
@@ -2093,8 +2093,7 @@ getmonth (char const *month, char **ea)
    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.  */
+# if 14 <= __GNUC__
 #  pragma GCC diagnostic push
 #  pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
 # endif
@@ -2106,6 +2105,9 @@ getmonth (char const *month, char **ea)
 #include "md5.h"
 
 #if DLOPEN_LIBCRYPTO && HAVE_OPENSSL_MD5
+# if 14 <= __GNUC__
+#  pragma GCC diagnostic pop
+# endif
 # include <dlfcn.h>
 
 /* Diagnose a dynamic linking failure.  */
@@ -2137,9 +2139,6 @@ 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
 }