]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix clang -Wunused-function warnings.
authorBruno Haible <bruno@clisp.org>
Thu, 30 Nov 2023 07:24:18 +0000 (08:24 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 30 Nov 2023 07:24:18 +0000 (08:24 +0100)
* gettext-runtime/src/envsubst.c: Include attribute.h.
(string_list_member, string_list_destroy): Mark as MAYBE_UNUSED.
* gettext-tools/src/format-scheme.c: Include attribute.h.
(II): Mark as MAYBE_UNUSED.
* gettext-tools/src/msgl-fsearch.c: Include attribute.h.
(add_index): Mark as MAYBE_UNUSED.
* gettext-tools/src/po-lex.c: Include attribute.h.
(mb_isnul, mb_cmp, mb_equal, mb_isascii, mb_putc, mb_setascii): Mark as
MAYBE_UNUSED.
* gettext-tools/src/write-qt.c: Include attribute.h.
(write_u16): Mark as MAYBE_UNUSED.
* gettext-tools/src/x-awk.c (free_token): Mark as MAYBE_UNUSED.
* gettext-tools/src/x-python.c (phase0_ungetc): Mark as MAYBE_UNUSED.

gettext-runtime/src/envsubst.c
gettext-tools/src/format-scheme.c
gettext-tools/src/msgl-fsearch.c
gettext-tools/src/po-lex.c
gettext-tools/src/write-qt.c
gettext-tools/src/x-awk.c
gettext-tools/src/x-python.c

index 692a50992ad610abc868407cedbfbc2db6b6d204..de3589c568d5a9dfc94227936af9f4e3498768cb 100644 (file)
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <locale.h>
 
+#include "attribute.h"
 #include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
@@ -358,7 +359,7 @@ string_list_sort (string_list_ty *slp)
 }
 
 /* Test whether a string list contains a given string.  */
-static inline int
+MAYBE_UNUSED static inline int
 string_list_member (const string_list_ty *slp, const char *s)
 {
   size_t j;
@@ -402,7 +403,7 @@ sorted_string_list_member (const string_list_ty *slp, const char *s)
 }
 
 /* Destroy a list of strings.  */
-static inline void
+MAYBE_UNUSED static inline void
 string_list_destroy (string_list_ty *slp)
 {
   size_t j;
index 2084fdb68df639723cf4a4d0915377f8b8b600aa..a8df14b904244f642a0583c08c450bab57acd4c7 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 
+#include "attribute.h"
 #include "format.h"
 #include "c-ctype.h"
 #include "gcd.h"
@@ -2321,7 +2322,7 @@ make_repeated_list (struct format_arg_list *sublist, unsigned int period)
 
 /* Possible signatures of format directives.  */
 static const enum format_arg_type I [1] = { FAT_INTEGER_NULL };
-_GL_ATTRIBUTE_MAYBE_UNUSED
+MAYBE_UNUSED
 static const enum format_arg_type II [2] = {
   FAT_INTEGER_NULL, FAT_INTEGER_NULL
 };
index bd78a8600745a1de080ba547e22ecd2c3b4df667..08543514aa9f97865c2947f26faa0938874cc505 100644 (file)
@@ -25,6 +25,7 @@
 #include <math.h>
 #include <stdlib.h>
 
+#include "attribute.h"
 #include "xalloc.h"
 #include "po-charset.h"
 
@@ -130,7 +131,7 @@ addlast_index (index_list_ty list, index_ty idx)
 /* Add a given index to an index list.
    Return the new index list, if it had to be reallocated, or NULL if it
    didn't change.  */
-static inline index_list_ty
+MAYBE_UNUSED static inline index_list_ty
 add_index (index_list_ty list, index_ty idx)
 {
   index_list_ty result;
index e6420456f870df2d44134413aeff367c90441e76..278016d16eab4d03e70acfe1caecad28ad1ff183 100644 (file)
@@ -36,6 +36,7 @@
 # include <iconv.h>
 #endif
 
+#include "attribute.h"
 #include "c-ctype.h"
 #include "uniwidth.h"
 #include "gettext.h"
@@ -169,7 +170,7 @@ mb_iseq (const mbchar_t mbc, char sc)
     return (mbc->bytes == 1 && mbc->buf[0] == sc);
 }
 
-static inline bool
+MAYBE_UNUSED static inline bool
 mb_isnul (const mbchar_t mbc)
 {
 #if HAVE_ICONV
@@ -180,7 +181,7 @@ mb_isnul (const mbchar_t mbc)
     return (mbc->bytes == 1 && mbc->buf[0] == 0);
 }
 
-static inline int
+MAYBE_UNUSED static inline int
 mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2)
 {
 #if HAVE_ICONV
@@ -195,7 +196,7 @@ mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2)
               : (memcmp (mbc1->buf, mbc2->buf, mbc2->bytes) >= 0 ? 1 : -1));
 }
 
-static inline bool
+MAYBE_UNUSED static inline bool
 mb_equal (const mbchar_t mbc1, const mbchar_t mbc2)
 {
 #if HAVE_ICONV
@@ -209,7 +210,7 @@ mb_equal (const mbchar_t mbc1, const mbchar_t mbc2)
 
 /* <ctype.h>, <wctype.h> classification.  */
 
-static inline bool
+MAYBE_UNUSED static inline bool
 mb_isascii (const mbchar_t mbc)
 {
 #if HAVE_ICONV
@@ -279,14 +280,14 @@ mb_width (struct po_parser_state *ps, const mbchar_t mbc)
 }
 
 /* Output.  */
-static inline void
+MAYBE_UNUSED static inline void
 mb_putc (const mbchar_t mbc, FILE *stream)
 {
   fwrite (mbc->buf, 1, mbc->bytes, stream);
 }
 
 /* Assignment.  */
-static inline void
+MAYBE_UNUSED static inline void
 mb_setascii (mbchar_t mbc, char sc)
 {
   mbc->bytes = 1;
index e7e054c6822628b4b31f7b6c46c059fd178a2a63..73dea734acb77518b0160d85e80d960ecb9d7ea0 100644 (file)
@@ -1,5 +1,5 @@
 /* Writing Qt .qm files.
-   Copyright (C) 2003, 2005-2007, 2009, 2016, 2020 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005-2007, 2009, 2016, 2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "attribute.h"
 #include "error.h"
 #include "xerror.h"
 #include "message.h"
@@ -189,7 +190,7 @@ write_u8 (FILE *output_file, unsigned char value)
 }
 
 /* Write a u16 (two bytes) to the output stream.  */
-static inline void
+MAYBE_UNUSED static inline void
 write_u16 (FILE *output_file, unsigned short value)
 {
   unsigned char data[2];
index 50643c6e1c5da1bef0f3459c69fd50d558b5fb9e..ef21967f69111a9ac7b6654c14195d62684ae167 100644 (file)
@@ -345,7 +345,7 @@ phase7_getc ()
 
 
 /* Free the memory pointed to by a 'struct token_ty'.  */
-static inline void
+MAYBE_UNUSED static inline void
 free_token (token_ty *tp)
 {
   switch (tp->type)
index 38f6f82a5eb00e22f7d6f916c1654155135d1097..b5edb1ab74f528a638dbef1faaea9d2c039e3e1b 100644 (file)
@@ -197,7 +197,7 @@ phase0_getc ()
 }
 
 /* Supports only one pushback character, and not '\n'.  */
-static inline void
+MAYBE_UNUSED static inline void
 phase0_ungetc (int c)
 {
   if (c != EOF)