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

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

ChangeLog
lib/gettext.h

index b259d9bcafda6dca4dc59c9002f17e183f00532a..e168863f6721cc0593af8c546f9d6b0761a6639d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-06-01  Bruno Haible  <bruno@clisp.org>
+
+       gettext-h: Avoid warnings from "gcc -Wextra".
+       Reported by Collin Funk in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00280.html>.
+       * lib/gettext.h (gettext, dgettext, dcgettext): Silence
+       -Wbuiltin-declaration-mismatch warning.
+
 2025-05-31  Bruno Haible  <bruno@clisp.org>
 
        stat-time tests: Add C++ tests.
index 7a7f02e3ee73cc3d63e553d3bc6c0b0915e10a0c..fd6c62b7eb7f5fe70fd4fde9ab84c099e681f7c0 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.  */