]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Reduce explicit use of __attribute__.
authorBruno Haible <bruno@clisp.org>
Sat, 9 May 2020 00:12:28 +0000 (02:12 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 9 May 2020 00:46:24 +0000 (02:46 +0200)
* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC): Add noreturn.
* gettext-runtime/src/envsubst.c: Include noreturn.h.
(usage): Use _GL_NORETURN_FUNC.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/src/msggrep.c: Include noreturn.h.
(no_pass, usage): Use _GL_NORETURN_FUNC.
* gettext-tools/src/msgl-iconv.c: Include noreturn.h.
(conversion_error): Use _GL_NORETURN_FUNC.
* gettext-tools/tests/tstgettext.c: Include noreturn.h.
(usage): Use _GL_NORETURN_FUNC.
* gettext-tools/tests/tstngettext.c: Likewise.

25 files changed:
autogen.sh
gettext-runtime/src/envsubst.c
gettext-runtime/src/gettext.c
gettext-runtime/src/ngettext.c
gettext-tools/src/hostname.c
gettext-tools/src/msgattrib.c
gettext-tools/src/msgcat.c
gettext-tools/src/msgcmp.c
gettext-tools/src/msgcomm.c
gettext-tools/src/msgconv.c
gettext-tools/src/msgen.c
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msgfmt.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/msgl-iconv.c
gettext-tools/src/msgmerge.c
gettext-tools/src/msgunfmt.c
gettext-tools/src/msguniq.c
gettext-tools/src/recode-sr-latin.c
gettext-tools/src/urlget.c
gettext-tools/src/xgettext.c
gettext-tools/tests/tstgettext.c
gettext-tools/tests/tstngettext.c

index dff0179240cfc686f891e97dd7219fb7d178d246..4c820f3a7a493e8a6c4b76438bee80c987e89d72 100755 (executable)
@@ -78,6 +78,7 @@ if ! $skip_gnulib; then
     gettext-h
     havelib
     memmove
+    noreturn
     progname
     propername
     relocatable-prog
@@ -169,6 +170,7 @@ if ! $skip_gnulib; then
     memset
     minmax
     mkdir
+    noreturn
     obstack
     open
     opendir
index 5ad539d3feb44bbed3bb459373c7f8cc44ac6a70..0b55080765c0eb83b003bc5c122ba177f4675e7b 100644 (file)
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <locale.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -53,11 +54,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void print_variables (const char *string);
 static void note_variables (const char *string);
 static void subst_from_stdin (void);
index c642de2aad38b86368c98a7f178a16853738bbb3..50770cf5c23a0e65ed874c17ffd93e555bc5a8e1 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <locale.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -59,11 +60,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 int
 main (int argc, char *argv[])
index 1750fea91f59004ea54a93ad814df320a59ff99b..841665c616e0f8ff418b3e6a524a8fce19f53f9a 100644 (file)
@@ -26,6 +26,7 @@
 #include <locale.h>
 #include <errno.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -53,11 +54,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 int
 main (int argc, char *argv[])
index ae075fa25b5f057b9b900a06d1adf3e5e3d01789..cead2cfaa5157e2f98401571de0da5dce7582b33 100644 (file)
@@ -81,6 +81,7 @@
 /* Include this after <sys/socket.h>, to avoid a syntax error on BeOS.  */
 #include <stdbool.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "error-progname.h"
@@ -111,11 +112,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void print_hostname (void);
 
 int
index 6c6e10afd5faf9dd0fb05b27bcd093f18d824276..7e6f2ff3c14101cbb05b53c8abfc2b3f7558cc62 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -126,11 +127,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp,
                                                   msgdomain_list_ty *only_mdlp,
                                                 msgdomain_list_ty *ignore_mdlp);
index 0a0852accf08ace761c5b607836fba64a6f3e0f6..d58ee91ff9d87d916a33cf73ec884333e51516b4 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "str-list.h"
@@ -96,11 +97,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 
 int
index 741d1ee788d4f239247556f8a1fb3c1690243af6..2dfb749735be950754b3e943f589fc0b042124ad 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <locale.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -80,11 +81,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void compare (const char *fn1, const char *fn2,
                      catalog_input_format_ty input_syntax);
 
index 2b76740a415bced05a344368ca72af5ca8f5b618..ed362dad0bfb90cd9769391fcf4bc77cafae10f8 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "str-list.h"
@@ -97,11 +98,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 
 int
index 1ddd3a23de55ad68504a43b424c35d483432ace5..d4f1e531b3ebdd7877c069a020343fcd7470e892 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -89,11 +90,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 
 int
index b8ad4f5597167a82bbb096b93ab7d4f71900c516..960adda145089131fa44780d087d87f8753df45d 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -86,11 +87,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 
 int
index ec3dd940826422b9f6d314b54983119a6631cfa9..13411da38262ab58f7e4fd123fa00f8ec217dea8 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -91,11 +92,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void process_msgdomain_list (const msgdomain_list_ty *mdlp);
 
 
index 308feb40bd65ef0d42f6541fe7447e8b37aa4d97..f5e4e64fefb4271227ffcf7310946b1d43886d8e 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -119,11 +120,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void generic_filter (const char *str, size_t len, char **resultp, size_t *lengthp);
 static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp);
 
index 06c612a81dea12be5daab2afa94e93249a79789a..4da5bfa0d07a1e3b648abbde42ec0ab9ba7bb7cd 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/stat.h>
 #include <assert.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "str-list.h"
 #include "dir-list.h"
@@ -218,11 +219,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static const char *add_mo_suffix (const char *);
 static struct msg_domain *new_domain (const char *name, const char *file_name);
 static bool is_nonobsolete (const message_ty *mp);
index 6f17e2466a9685926e303490c03cdb2389919510..6bb1a74a4c3d1efb962ba6d6047c3ec58aa7d314 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -132,16 +133,8 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void no_pass (int opt)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void no_pass (int opt);
+_GL_NORETURN_FUNC static void usage (int status);
 static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp);
 
 
index bf4a303cf1148dd0364bfb7dfc93624a3b095b6a..ff0b7d78241e83d2e9ae5a89115ae33bed0c3ea9 100644 (file)
@@ -54,6 +54,7 @@
 /* Get BINDIR.  */
 #include "configmake.h"
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "error-progname.h"
@@ -136,11 +137,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static const char *find_pot (void);
 static const char *catalogname_for_locale (const char *locale);
 static const char *language_of_locale (const char *locale);
index a9bada3bc0c0d52b76f9e44ecee374c9882ef805..c66d14a0be2e8f043e0857fd79e5db55ab6eaac7 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list charset and locale charset handling.
-   Copyright (C) 2001-2003, 2005-2009, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2009, 2019-2020 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -32,6 +32,7 @@
 # include <iconv.h>
 #endif
 
+#include "noreturn.h"
 #include "progname.h"
 #include "basename.h"
 #include "message.h"
 
 #if HAVE_ICONV
 
-static void conversion_error (const struct conversion_context* context)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void conversion_error (const struct conversion_context* context);
 static void
 conversion_error (const struct conversion_context* context)
 {
index 424de7fde221443f4188e728cfb008aa1aa44a77..42facb2805f4d9062e7b1aa5b6866d69aa856b0d 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "error.h"
@@ -167,11 +168,7 @@ struct statistics
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void compendium (const char *filename);
 static void msgdomain_list_stablesort_by_obsolete (msgdomain_list_ty *mdlp);
 static msgdomain_list_ty *merge (const char *fn1, const char *fn2,
index f23b90be0b7795d12af13c5a882af1e9acb9e405..8120316c9a28ba2e41946177cd0350d27d5a33b9 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "error-progname.h"
@@ -107,11 +108,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void read_one_file (message_list_ty *mlp, const char *filename);
 
 
index cd3ff547852b525f462baab1743b2241088a8688..6616ced3eebaa34c5559a14a1aea246260427ddd 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "dir-list.h"
 #include "str-list.h"
@@ -92,11 +93,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 
 int
index c1998339336d44f52f08b07c81cfe249ca3b4c87..23d21cde45eaa05d4415f664e15c031a46bbf593 100644 (file)
@@ -31,6 +31,7 @@
 #include <iconv.h>
 #endif
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -56,11 +57,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void process (FILE *stream);
 
 int
index 5b4289c5ff81c64177214154317ee69376d99be5..97e9d0fda5a088758743be2a488883dbd0fe59fb 100644 (file)
@@ -30,6 +30,7 @@
 #include <locale.h>
 #include <unistd.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "error-progname.h"
@@ -81,11 +82,7 @@ static const struct option long_options[] =
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void fetch (const char *url, const char *file);
 
 
index 72b6e2b08ab50dd76871cf33981bb8729adffe4e..f5e8765c17580900394d191a86b58b3692da0641 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <textstyle.h>
 
+#include "noreturn.h"
 #include "rc-str-list.h"
 #include "xg-encoding.h"
 #include "xg-arglist-context.h"
@@ -303,11 +304,7 @@ struct extractor_ty
 
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2)
-        __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 static void read_exclusion_file (char *file_name);
 static void extract_from_file (const char *file_name, extractor_ty extractor,
                                msgdomain_list_ty *mdlp);
index 8845ce0906dc67f3fde4091067b179eaf1aad760..cff65313baf35d5de3450499b3fa98817693d9c6 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <locale.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -69,11 +70,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int status);
 
 int
 main (int argc, char *argv[])
index 9b253aaf4d48e310beaaea7eec67e8f2690e1195..eef1cdee00dac0d5353670ef0bf81839b062e59e 100644 (file)
@@ -26,6 +26,7 @@
 #include <locale.h>
 #include <errno.h>
 
+#include "noreturn.h"
 #include "closeout.h"
 #include "error.h"
 #include "progname.h"
@@ -57,11 +58,7 @@ static const struct option long_options[] =
 };
 
 /* Forward declaration of local functions.  */
-static void usage (int __status)
-#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
-     __attribute__ ((noreturn))
-#endif
-;
+_GL_NORETURN_FUNC static void usage (int __status);
 
 int
 main (int argc, char *argv[])