From: Bruno Haible Date: Sun, 6 Sep 2020 23:08:11 +0000 (+0200) Subject: Fix "warning: unannotated fall-through between switch labels". X-Git-Tag: v0.21.1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e90c28ec9b8711d3eb456757a822e8064021f461;p=thirdparty%2Fgettext.git Fix "warning: unannotated fall-through between switch labels". * autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Add 'attribute'. * libtextstyle/autogen.sh (GNULIB_MODULES): Likewise. * gettext-runtime/intl/plural.y: Include attribute.h. Use FALLTHROUGH annotated empty statements instead of /* FALLTHROUGH */ comments. * gettext-runtime/src/gettext.c: Likewise. * gettext-runtime/src/ngettext.c: Likewise. * gettext-tools/src/format-boost.c: Likewise. * gettext-tools/src/read-stringtable.c: Likewise. * gettext-tools/src/write-csharp.c: Likewise. * gettext-tools/src/write-java.c: Likewise. * gettext-tools/src/write-po.c: Likewise. * gettext-tools/src/x-awk.c: Likewise. * gettext-tools/src/x-c.c: Likewise. * gettext-tools/src/x-csharp.c: Likewise. * gettext-tools/src/x-elisp.c: Likewise. * gettext-tools/src/x-java.c: Likewise. * gettext-tools/src/x-javascript.c: Likewise. * gettext-tools/src/x-librep.c: Likewise. * gettext-tools/src/x-lisp.c: Likewise. * gettext-tools/src/x-perl.c: Likewise. * gettext-tools/src/x-php.c: Likewise. * gettext-tools/src/x-python.c: Likewise. * gettext-tools/src/x-scheme.c: Likewise. * gettext-tools/src/x-sh.c: Likewise. * gettext-tools/src/x-smalltalk.c: Likewise. * gettext-tools/src/x-tcl.c: Likewise. * gettext-tools/src/x-vala.c: Likewise. * gettext-tools/src/x-ycp.c: Likewise. * gettext-tools/tests/tstgettext.c: Likewise. * gettext-tools/tests/tstngettext.c: Likewise. * libtextstyle/gnulib-local/lib/tparm.c: Likewise. * gettext-runtime/src/escapes.h: Use FALLTHROUGH annotated empty statements instead of /* FALLTHROUGH */ comments. --- diff --git a/autogen.sh b/autogen.sh index 0d62f61f8..b896c3f1e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -70,6 +70,7 @@ if ! $skip_gnulib; then # In gettext-runtime: GNULIB_MODULES_RUNTIME_FOR_SRC=' atexit + attribute basename-lgpl binary-io closeout @@ -121,6 +122,7 @@ if ! $skip_gnulib; then GNULIB_MODULES_TOOLS_FOR_SRC=' alloca-opt atexit + attribute backupfile basename-lgpl binary-io @@ -301,8 +303,9 @@ if ! $skip_gnulib; then done` \ $GNULIB_MODULES_TOOLS_FOR_LIBGREP || exit $? # In gettext-tools/libgettextpo: - # This is a subset of the GNULIB_MODULES_FOR_SRC. + # This is a subset of the GNULIB_MODULES_TOOLS_FOR_SRC. GNULIB_MODULES_LIBGETTEXTPO=' + attribute basename-lgpl close c-ctype diff --git a/gettext-runtime/intl/plural.y b/gettext-runtime/intl/plural.y index 676232e10..be78cebf8 100644 --- a/gettext-runtime/intl/plural.y +++ b/gettext-runtime/intl/plural.y @@ -24,6 +24,7 @@ #include #include #include "plural-exp.h" +#include "attribute.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ @@ -210,13 +211,13 @@ FREE_EXPRESSION (struct expression *exp) { case 3: FREE_EXPRESSION (exp->val.args[2]); - /* FALLTHROUGH */ + FALLTHROUGH; case 2: FREE_EXPRESSION (exp->val.args[1]); - /* FALLTHROUGH */ + FALLTHROUGH; case 1: FREE_EXPRESSION (exp->val.args[0]); - /* FALLTHROUGH */ + FALLTHROUGH; default: break; } diff --git a/gettext-runtime/src/escapes.h b/gettext-runtime/src/escapes.h index acda05403..2af737560 100644 --- a/gettext-runtime/src/escapes.h +++ b/gettext-runtime/src/escapes.h @@ -1,5 +1,5 @@ /* Expand escape sequences in a string. - Copyright (C) 1995-1997, 2000-2007, 2012, 2018-2019 Free Software + Copyright (C) 1995-1997, 2000-2007, 2012, 2018-2020 Free Software Foundation, Inc. Written by Ulrich Drepper , May 1995. @@ -112,7 +112,7 @@ expand_escapes (const char *str, bool *backslash_c_seen) ++cp; break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: *rp++ = '\\'; break; diff --git a/gettext-runtime/src/gettext.c b/gettext-runtime/src/gettext.c index 99fd82d6a..4773fe5f0 100644 --- a/gettext-runtime/src/gettext.c +++ b/gettext-runtime/src/gettext.c @@ -27,6 +27,7 @@ #include #include +#include "attribute.h" #include "noreturn.h" #include "closeout.h" #include "error.h" @@ -160,7 +161,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ case 2: domain = argv[optind++]; - /* FALLTHROUGH */ + FALLTHROUGH; case 1: break; diff --git a/gettext-runtime/src/ngettext.c b/gettext-runtime/src/ngettext.c index d10f2c3c7..c0b3ca506 100644 --- a/gettext-runtime/src/ngettext.c +++ b/gettext-runtime/src/ngettext.c @@ -26,6 +26,7 @@ #include #include +#include "attribute.h" #include "noreturn.h" #include "closeout.h" #include "error.h" @@ -143,7 +144,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ case 4: domain = argv[optind++]; - /* FALLTHROUGH */ + FALLTHROUGH; case 3: break; diff --git a/gettext-tools/src/format-boost.c b/gettext-tools/src/format-boost.c index 4cf023cee..3f3b9781e 100644 --- a/gettext-tools/src/format-boost.c +++ b/gettext-tools/src/format-boost.c @@ -22,6 +22,7 @@ #include #include +#include "attribute.h" #include "format.h" #include "c-ctype.h" #include "xalloc.h" @@ -417,7 +418,7 @@ format_parse (const char *format, bool translated, char *fdi, type = FAT_ANY; break; } - /*FALLTHROUGH*/ + FALLTHROUGH; default: --format; if (*format == '\0') diff --git a/gettext-tools/src/read-stringtable.c b/gettext-tools/src/read-stringtable.c index 5e5c6f915..7a690dc41 100644 --- a/gettext-tools/src/read-stringtable.c +++ b/gettext-tools/src/read-stringtable.c @@ -1,5 +1,5 @@ /* Reading NeXTstep/GNUstep .strings files. - Copyright (C) 2003, 2005-2007, 2009, 2019 Free Software Foundation, Inc. + Copyright (C) 2003, 2005-2007, 2009, 2019-2020 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "error.h" #include "error-progname.h" #include "read-catalog-abstract.h" @@ -639,7 +640,7 @@ phase4_getc () && !seen_newline); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; diff --git a/gettext-tools/src/write-csharp.c b/gettext-tools/src/write-csharp.c index 1a238da79..460ab8cd0 100644 --- a/gettext-tools/src/write-csharp.c +++ b/gettext-tools/src/write-csharp.c @@ -70,6 +70,7 @@ # define S_IXOTH (S_IXUSR >> 6) #endif +#include "attribute.h" #include "c-ctype.h" #include "relocatable.h" #include "error.h" @@ -402,7 +403,7 @@ write_csharp_expression (FILE *stream, const struct expression *exp, bool as_boo fprintf (stream, ")"); return; } - /*FALLTHROUGH*/ + FALLTHROUGH; case var: case mult: case divide: diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c index 0b0b13216..970aae6f0 100644 --- a/gettext-tools/src/write-java.c +++ b/gettext-tools/src/write-java.c @@ -53,6 +53,7 @@ # define S_IXUSR 00100 #endif +#include "attribute.h" #include "c-ctype.h" #include "error.h" #include "xerror.h" @@ -624,7 +625,7 @@ write_java_expression (FILE *stream, const struct expression *exp, bool as_boole fprintf (stream, ")"); return; } - /*FALLTHROUGH*/ + FALLTHROUGH; case var: case mult: case divide: diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index adfa55669..4338e8ef4 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2010, 2012, 2014-2015, 2018-2019 Free Software + Copyright (C) 1995-1998, 2000-2010, 2012, 2014-2015, 2018-2020 Free Software Foundation, Inc. This file was written by Peter Miller @@ -37,6 +37,7 @@ #include +#include "attribute.h" #include "c-ctype.h" #include "po-charset.h" #include "format.h" @@ -79,7 +80,7 @@ make_format_description_string (enum is_format is_format, const char *lang, sprintf (result, "possible-%s-format", lang); break; } - /* FALLTHROUGH */ + FALLTHROUGH; case yes_according_to_context: case yes: sprintf (result, "%s-format", lang); diff --git a/gettext-tools/src/x-awk.c b/gettext-tools/src/x-awk.c index af066ff15..c2b8ddcd8 100644 --- a/gettext-tools/src/x-awk.c +++ b/gettext-tools/src/x-awk.c @@ -1,5 +1,5 @@ /* xgettext awk backend. - Copyright (C) 2002-2003, 2005-2009, 2018-2019 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2009, 2018-2020 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -401,7 +402,7 @@ x_awk_lex (token_ty *tp) FIXME: Newlines after any of ',' '{' '?' ':' '||' '&&' 'do' 'else' does *not* introduce a fresh statement. */ prefer_division_over_regexp = false; - /* FALLTHROUGH */ + FALLTHROUGH; case '\t': case ' ': /* Ignore whitespace and comments. */ @@ -428,7 +429,7 @@ x_awk_lex (token_ty *tp) return; } } - /* FALLTHROUGH */ + FALLTHROUGH; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': @@ -645,7 +646,7 @@ x_awk_lex (token_ty *tp) prefer_division_over_regexp = false; return; } - /* FALLTHROUGH */ + FALLTHROUGH; default: /* We could carefully recognize each of the 2 and 3 character diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c index 08edb12b1..0f19f9665 100644 --- a/gettext-tools/src/x-c.c +++ b/gettext-tools/src/x-c.c @@ -30,6 +30,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -664,7 +665,7 @@ phase1_ungetc (int c) case '\n': --line_number; - /* FALLTHROUGH */ + FALLTHROUGH; default: if (phase1_pushback_length == SIZEOF (phase1_pushback)) @@ -882,7 +883,7 @@ phase4_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -1344,7 +1345,7 @@ phase5_get (token_ty *tp) error (0, 0, _("%s:%d: warning: a double-quote in the delimiter of a raw string literal is unsupported"), logical_file_name, starting_line_number); error_with_progname = true; - /* FALLTHROUGH */ + FALLTHROUGH; default: valid_delimiter_char = false; break; @@ -1450,7 +1451,7 @@ phase5_get (token_ty *tp) tp->type = token_type_symbol; return; } - /* FALLTHROUGH */ + FALLTHROUGH; default: phase4_ungetc (c); @@ -1482,7 +1483,7 @@ phase5_get (token_ty *tp) c = '.'; break; } - /* FALLTHROUGH */ + FALLTHROUGH; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -1505,7 +1506,7 @@ phase5_get (token_ty *tp) case 'P': /* In C99 and C++17, 'p' and 'P' can be used as an exponent marker. */ - /* FALLTHROUGH */ + FALLTHROUGH; case 'e': case 'E': if (bufpos >= bufmax) @@ -1586,7 +1587,7 @@ phase5_get (token_ty *tp) break; } } - /* FALLTHROUGH */ + FALLTHROUGH; default: phase4_ungetc (c); break; @@ -1703,7 +1704,7 @@ phase5_get (token_ty *tp) tp->comment = add_reference (savable_comment); return; } - /* FALLTHROUGH */ + FALLTHROUGH; default: /* We could carefully recognize each of the 2 and 3 character @@ -2145,7 +2146,7 @@ x_c_lex (xgettext_token_ty *tp) case token_type_objc_special: drop_reference (token.comment); - /* FALLTHROUGH */ + FALLTHROUGH; default: last_non_comment_line = newline_count; diff --git a/gettext-tools/src/x-csharp.c b/gettext-tools/src/x-csharp.c index 5cf72adbb..13d4a5310 100644 --- a/gettext-tools/src/x-csharp.c +++ b/gettext-tools/src/x-csharp.c @@ -28,6 +28,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -620,7 +621,7 @@ phase4_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -1496,7 +1497,7 @@ phase6_get (token_ty *tp) case UNL: if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\t': case '\f': @@ -1536,7 +1537,7 @@ phase6_get (token_ty *tp) tp->type = token_type_dot; return; } - /* FALLTHROUGH */ + FALLTHROUGH; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -1651,7 +1652,7 @@ phase6_get (token_ty *tp) tp->type = token_type_string_literal; return; } - /* FALLTHROUGH, so that @identifier is recognized. */ + FALLTHROUGH; /* so that @identifier is recognized. */ default: if (c == '\\') diff --git a/gettext-tools/src/x-elisp.c b/gettext-tools/src/x-elisp.c index b29fce5d0..ae0372d5b 100644 --- a/gettext-tools/src/x-elisp.c +++ b/gettext-tools/src/x-elisp.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -527,7 +528,7 @@ do_getc_escaped (int c, bool in_string) if (c != '-') /* Invalid input. But be tolerant. */ return c; - /*FALLTHROUGH*/ + FALLTHROUGH; case '^': c = do_getc (); if (c == EOF) @@ -1188,7 +1189,7 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag, } } c = '.'; - /*FALLTHROUGH*/ + FALLTHROUGH; default: default_label: if (c <= ' ') /* FIXME: Assumes ASCII compatible encoding */ diff --git a/gettext-tools/src/x-java.c b/gettext-tools/src/x-java.c index eff1e6f7f..e89ab95f4 100644 --- a/gettext-tools/src/x-java.c +++ b/gettext-tools/src/x-java.c @@ -28,6 +28,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -519,7 +520,7 @@ phase4_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -1060,7 +1061,7 @@ phase5_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\t': case '\f': @@ -1100,7 +1101,7 @@ phase5_get (token_ty *tp) tp->type = token_type_dot; return; } - /* FALLTHROUGH */ + FALLTHROUGH; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': diff --git a/gettext-tools/src/x-javascript.c b/gettext-tools/src/x-javascript.c index 54ab51a7b..7545adafb 100644 --- a/gettext-tools/src/x-javascript.c +++ b/gettext-tools/src/x-javascript.c @@ -31,6 +31,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -601,7 +602,7 @@ phase3_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -1146,7 +1147,7 @@ phase5_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\t': case '\f': @@ -1169,7 +1170,7 @@ phase5_get (token_ty *tp) return; } } - /* FALLTHROUGH */ + FALLTHROUGH; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': diff --git a/gettext-tools/src/x-librep.c b/gettext-tools/src/x-librep.c index fc346bf08..d694a0b51 100644 --- a/gettext-tools/src/x-librep.c +++ b/gettext-tools/src/x-librep.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "c-ctype.h" #include "message.h" #include "xgettext.h" @@ -371,7 +372,7 @@ read_token (struct token *tp, const int *first) radix = 0; break; } - /*FALLTHROUGH*/ + FALLTHROUGH; default: if (exponent && (c == '+' || c == '-')) break; @@ -752,7 +753,7 @@ read_object (struct object *op, flag_context_ty outer_context) if (c != EOF && c != '@') do_ungetc (c); } - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': case '`': { @@ -908,7 +909,7 @@ read_object (struct object *op, flag_context_ty outer_context) } continue; } - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': case ':': { diff --git a/gettext-tools/src/x-lisp.c b/gettext-tools/src/x-lisp.c index 921db484f..0137ffdfb 100644 --- a/gettext-tools/src/x-lisp.c +++ b/gettext-tools/src/x-lisp.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -1127,7 +1128,7 @@ read_object (struct object *op, flag_context_ty outer_context) if (c != EOF && c != '@' && c != '.') do_ungetc (c); } - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': case '`': { @@ -1230,7 +1231,7 @@ read_object (struct object *op, flag_context_ty outer_context) case '(': case '"': do_ungetc (c); - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': case ':': case '.': diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index 58892cddf..7d58fc3b7 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -984,7 +985,7 @@ extract_quotelike_pass3 (token_ty *tp, int error_level) buffer[bufpos++] = '\\'; break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: buffer[bufpos++] = *crs++; break; @@ -1666,7 +1667,7 @@ extract_variable (message_list_ty *mlp, token_ty *tp, int first) treat incorrectly here, is a syntax error. */ phase1_ungetc (c2); } - /* FALLTHROUGH */ + FALLTHROUGH; default: #if DEBUG_PERL @@ -2007,7 +2008,7 @@ interpolate_keywords (message_list_ty *mlp, const char *string, int lineno) break; } /* Must be right brace. */ - /* FALLTHROUGH */ + FALLTHROUGH; case wait_rbrace: switch (c) { @@ -2019,7 +2020,7 @@ interpolate_keywords (message_list_ty *mlp, const char *string, int lineno) extract_quotelike_pass3 (&token, EXIT_FAILURE); remember_a_message (mlp, NULL, token.string, true, false, context, &pos, NULL, savable_comment, true); - /* FALLTHROUGH */ + FALLTHROUGH; default: context = null_context; state = initial; @@ -2144,7 +2145,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case '\t': case ' ': /* Ignore whitespace. */ @@ -2181,7 +2182,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp) return; } } - /* FALLTHROUGH */ + FALLTHROUGH; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': @@ -2615,7 +2616,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp) if (c != '/') phase1_ungetc (c); } - /* FALLTHROUGH */ + FALLTHROUGH; default: /* We could carefully recognize each of the 2 and 3 character diff --git a/gettext-tools/src/x-php.c b/gettext-tools/src/x-php.c index 410790961..78cce8e1d 100644 --- a/gettext-tools/src/x-php.c +++ b/gettext-tools/src/x-php.c @@ -28,6 +28,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -667,7 +668,7 @@ phase3_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -802,7 +803,7 @@ phase4_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\t': case '\r': diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c index 1dee06100..4c95797f7 100644 --- a/gettext-tools/src/x-python.c +++ b/gettext-tools/src/x-python.c @@ -30,6 +30,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -1223,7 +1224,7 @@ phase5_get (token_ty *tp) return; } } - /* FALLTHROUGH */ + FALLTHROUGH; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': diff --git a/gettext-tools/src/x-scheme.c b/gettext-tools/src/x-scheme.c index f29bfe5db..f879ab026 100644 --- a/gettext-tools/src/x-scheme.c +++ b/gettext-tools/src/x-scheme.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -830,7 +831,7 @@ read_object (struct object *op, flag_context_ty outer_context) if (c != EOF && c != '@') do_ungetc (c); } - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': case '`': { @@ -1220,7 +1221,7 @@ read_object (struct object *op, flag_context_ty outer_context) while (c >= '0' && c <= '9'); /* c should be one of {'a'|'b'|'c'|'e'|'i'|'s'|'u'}. But be tolerant. */ - /*FALLTHROUGH*/ + FALLTHROUGH; case '\'': /* boot-9.scm */ case '.': /* boot-9.scm */ case ',': /* srfi-10.scm */ @@ -1270,7 +1271,7 @@ read_object (struct object *op, flag_context_ty outer_context) } seen_underscore_prefix = true; } - /*FALLTHROUGH*/ + FALLTHROUGH; case '"': { diff --git a/gettext-tools/src/x-sh.c b/gettext-tools/src/x-sh.c index 2b0dedc12..a3f70086b 100644 --- a/gettext-tools/src/x-sh.c +++ b/gettext-tools/src/x-sh.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -222,7 +223,7 @@ phase1_ungetc (int c) case '\n': --line_number; - /* FALLTHROUGH */ + FALLTHROUGH; default: if (phase1_pushback_length == SIZEOF (phase1_pushback)) @@ -718,7 +719,7 @@ phase2_ungetc (int c) case '\n': --line_number; - /* FALLTHROUGH */ + FALLTHROUGH; default: if (phase2_pushback_length == SIZEOF (phase2_pushback)) diff --git a/gettext-tools/src/x-smalltalk.c b/gettext-tools/src/x-smalltalk.c index d84b307eb..86f6a4ba4 100644 --- a/gettext-tools/src/x-smalltalk.c +++ b/gettext-tools/src/x-smalltalk.c @@ -27,6 +27,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -237,7 +238,7 @@ phase2_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\t': case '\r': diff --git a/gettext-tools/src/x-tcl.c b/gettext-tools/src/x-tcl.c index 6b2b36cf7..f7f784684 100644 --- a/gettext-tools/src/x-tcl.c +++ b/gettext-tools/src/x-tcl.c @@ -31,6 +31,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "xgettext.h" #include "xg-pos.h" @@ -220,7 +221,7 @@ phase1_ungetc (int c) case '\n': case BS_NL: --line_number; - /* FALLTHROUGH */ + FALLTHROUGH; default: if (phase1_pushback_length == SIZEOF (phase1_pushback)) diff --git a/gettext-tools/src/x-vala.c b/gettext-tools/src/x-vala.c index d807f5a6c..e2754f73d 100644 --- a/gettext-tools/src/x-vala.c +++ b/gettext-tools/src/x-vala.c @@ -30,6 +30,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -296,7 +297,7 @@ phase2_getc () comment_line_end (2); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -670,7 +671,7 @@ phase3_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case ' ': case '\f': case '\t': @@ -748,7 +749,7 @@ phase3_get (token_ty *tp) c = '.'; break; } - /* FALLTHROUGH */ + FALLTHROUGH; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -845,7 +846,7 @@ phase3_get (token_ty *tp) return; } template = true; - /* FALLTHROUGH */ + FALLTHROUGH; case '"': { struct mixed_string_buffer msb; diff --git a/gettext-tools/src/x-ycp.c b/gettext-tools/src/x-ycp.c index 5097b5748..4f6d16871 100644 --- a/gettext-tools/src/x-ycp.c +++ b/gettext-tools/src/x-ycp.c @@ -29,6 +29,7 @@ #include #include +#include "attribute.h" #include "message.h" #include "rc-str-list.h" #include "xgettext.h" @@ -245,7 +246,7 @@ phase2_getc () savable_comment_add (buffer); break; } - /* FALLTHROUGH */ + FALLTHROUGH; default: last_was_star = false; @@ -445,7 +446,7 @@ phase5_get (token_ty *tp) case '\n': if (last_non_comment_line > last_comment_line) savable_comment_reset (); - /* FALLTHROUGH */ + FALLTHROUGH; case '\r': case '\t': case ' ': diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c index e473874fc..a855783b0 100644 --- a/gettext-tools/tests/tstgettext.c +++ b/gettext-tools/tests/tstgettext.c @@ -27,6 +27,7 @@ #include #include +#include "attribute.h" #include "noreturn.h" #include "closeout.h" #include "error.h" @@ -141,7 +142,7 @@ main (int argc, char *argv[]) break; } } - /*FALLTHROUGH*/ + FALLTHROUGH; default: usage (EXIT_FAILURE); } @@ -184,7 +185,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ case 2: domain = argv[optind++]; - /* FALLTHROUGH */ + FALLTHROUGH; case 1: break; diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c index 012399a3d..e9ce5c967 100644 --- a/gettext-tools/tests/tstngettext.c +++ b/gettext-tools/tests/tstngettext.c @@ -27,6 +27,7 @@ #include #include +#include "attribute.h" #include "noreturn.h" #include "closeout.h" #include "error.h" @@ -118,7 +119,7 @@ main (int argc, char *argv[]) break; } } - /*FALLTHROUGH*/ + FALLTHROUGH; default: usage (EXIT_FAILURE); } diff --git a/libtextstyle/autogen.sh b/libtextstyle/autogen.sh index 740dd6755..620875195 100755 --- a/libtextstyle/autogen.sh +++ b/libtextstyle/autogen.sh @@ -4,7 +4,7 @@ # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files # with new versions of autoconf or automake. # -# This script requires autoconf-2.63..2.71 and automake-1.11..1.16 in the PATH. +# This script requires autoconf-2.64..2.71 and automake-1.11..1.16 in the PATH. # If not used from a released tarball, it also requires # - the GNULIB_SRCDIR environment variable pointing to a gnulib checkout. @@ -85,6 +85,7 @@ if test $skip_gnulib = false; then html-styled-ostream noop-styled-ostream term-styled-ostream + attribute filename isatty largefile diff --git a/libtextstyle/gnulib-local/lib/tparm.c b/libtextstyle/gnulib-local/lib/tparm.c index 787667679..8b376a0e2 100644 --- a/libtextstyle/gnulib-local/lib/tparm.c +++ b/libtextstyle/gnulib-local/lib/tparm.c @@ -1,5 +1,5 @@ /* Substitution of parameters in strings from terminal descriptions. - Copyright (C) 2006, 2012 Free Software Foundation, Inc. + Copyright (C) 2006, 2012, 2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -22,6 +22,7 @@ #include #include +#include "attribute.h" #include "c-ctype.h" #ifdef USE_SCCS_IDS @@ -331,7 +332,7 @@ tparm (const char *str, ...) sp++; break; } - /* FALLTHROUGH */ + FALLTHROUGH; case 'C': if (*sp == 'C') { @@ -347,7 +348,7 @@ tparm (const char *str, ...) } } fmt = "%c"; - /* FALLTHROUGH */ + FALLTHROUGH; case 'a': if (!termcap) return OOPS; @@ -415,7 +416,7 @@ tparm (const char *str, ...) if (fmt == NULL) break; sp--; - /* FALLTHROUGH */ + FALLTHROUGH; case '-': if (!termcap) { @@ -429,7 +430,7 @@ tparm (const char *str, ...) break; } fmt = "%c"; - /* FALLTHROUGH */ + FALLTHROUGH; case 's': if (termcap && (fmt == NULL || *sp == '-')) { @@ -449,23 +450,23 @@ tparm (const char *str, ...) } if (!termcap) return OOPS; - /* FALLTHROUGH */ + FALLTHROUGH; case '.': if (termcap && fmt == NULL) fmt = "%c"; - /* FALLTHROUGH */ + FALLTHROUGH; case 'd': if (termcap && fmt == NULL) fmt = "%d"; - /* FALLTHROUGH */ + FALLTHROUGH; case '2': if (termcap && fmt == NULL) fmt = "%02d"; - /* FALLTHROUGH */ + FALLTHROUGH; case '3': if (termcap && fmt == NULL) fmt = "%03d"; - /* FALLTHROUGH */ + FALLTHROUGH; case ':': case ' ': case '#': case 'u': case 'x': case 'X': case 'o': case 'c': case '0': case '1': case '4': case '5':