]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid warnings from "gcc -Wextra".
authorBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2025 10:26:40 +0000 (12:26 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2025 10:26:40 +0000 (12:26 +0200)
Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00280.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): Silence
-Wbuiltin-declaration-mismatch warning.

gnulib-local/lib/gettext.h

index e7b1f88b3ac40167a9debcb5ccf753acd76b4ea7..37d58f013d5d195766659748fc320d9728d3aa4b 100644 (file)
    that don't occur with enabled NLS.  */
 /* The return type 'const char *' serves the purpose of producing warnings
    for invalid uses of the value returned from these functions.  */
+#  if __GNUC__ >= 9
+#   pragma GCC diagnostic push
+#   pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
+#  endif
 __attribute__ ((__always_inline__, __gnu_inline__)) extern inline
 #  if !defined(__sun)
 const
@@ -96,6 +100,9 @@ dcgettext (const char *domain, const char *msgid, int category)
   (void) category;
   return msgid;
 }
+#  if __GNUC__ >= 9
+#   pragma GCC diagnostic pop
+#  endif
 # else
 /* The casts to 'const char *' serve the purpose of producing warnings
    for invalid uses of the value returned from these functions.  */