]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gettext-h: Avoid warning with gcc < 4.2.
authorBruno Haible <bruno@clisp.org>
Sun, 14 Sep 2025 16:29:29 +0000 (18:29 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 15 Sep 2025 06:31:04 +0000 (08:31 +0200)
Reported by Orgad Shaneh <orgads@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00183.html>.

* lib/gettext.h (gettext, dgettext, dcgettext): Don't use attribute
__gnu_inline__ with gcc < 4.2.

ChangeLog
lib/gettext.h

index 8128c6ee4e87f021631622364628a76c98ac9e7a..135972e2f8af2614fe7b5907643cefa2f59a5616 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-09-14  Bruno Haible  <bruno@clisp.org>
+
+       gettext-h: Avoid warning with gcc < 4.2.
+       Reported by Orgad Shaneh <orgads@gmail.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00183.html>.
+       * lib/gettext.h (gettext, dgettext, dcgettext): Don't use attribute
+       __gnu_inline__ with gcc < 4.2.
+
 2025-09-14  Pádraig Brady  <P@draigBrady.com>
 
        crc-x86_64: honor GLIBC_TUNABLES to disable acceleration
index fd6c62b7eb7f5fe70fd4fde9ab84c099e681f7c0..0650abc9a3d7ec74703448f04cb9b5c31e294a5c 100644 (file)
 #   pragma GCC diagnostic push
 #   pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
 #  endif
-__attribute__ ((__always_inline__, __gnu_inline__)) extern inline
+#  if __GNUC__ + (__GNUC_MINOR__ >= 2) > 4
+__attribute__ ((__always_inline__, __gnu_inline__))
+#  else
+__attribute__ ((__always_inline__))
+#  endif
+extern inline
 #  if !defined(__sun)
 const
 #  endif
@@ -79,7 +84,12 @@ gettext (const char *msgid)
 {
   return msgid;
 }
-__attribute__ ((__always_inline__, __gnu_inline__)) extern inline
+#  if __GNUC__ + (__GNUC_MINOR__ >= 2) > 4
+__attribute__ ((__always_inline__, __gnu_inline__))
+#  else
+__attribute__ ((__always_inline__))
+#  endif
+extern inline
 #  if !defined(__sun)
 const
 #  endif
@@ -89,7 +99,12 @@ dgettext (const char *domain, const char *msgid)
   (void) domain;
   return msgid;
 }
-__attribute__ ((__always_inline__, __gnu_inline__)) extern inline
+#  if __GNUC__ + (__GNUC_MINOR__ >= 2) > 4
+__attribute__ ((__always_inline__, __gnu_inline__))
+#  else
+__attribute__ ((__always_inline__))
+#  endif
+extern inline
 #  if !defined(__sun)
 const
 #  endif