From: Bruno Haible Date: Sun, 1 Jun 2025 09:40:11 +0000 (+0200) Subject: gettext-h: Avoid warnings from "gcc -Wextra". X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fd89b2a86c1625b295049416dbfd112c8ff0198;p=thirdparty%2Fgnulib.git gettext-h: Avoid warnings from "gcc -Wextra". Reported by Collin Funk in . * lib/gettext.h (gettext, dgettext, dcgettext): Silence -Wbuiltin-declaration-mismatch warning. --- diff --git a/ChangeLog b/ChangeLog index b259d9bcaf..e168863f67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-06-01 Bruno Haible + + gettext-h: Avoid warnings from "gcc -Wextra". + Reported by Collin Funk in + . + * lib/gettext.h (gettext, dgettext, dcgettext): Silence + -Wbuiltin-declaration-mismatch warning. + 2025-05-31 Bruno Haible stat-time tests: Add C++ tests. diff --git a/lib/gettext.h b/lib/gettext.h index 7a7f02e3ee..fd6c62b7eb 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -66,6 +66,10 @@ 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. */