From: Bruno Haible Date: Thu, 5 Oct 2023 06:20:50 +0000 (+0200) Subject: xgettext: Clarify some diagnostics as errors vs. warnings. X-Git-Tag: v0.23~319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034b2e152cea348bd639919d1f35b0ddeb9c56aa;p=thirdparty%2Fgettext.git xgettext: Clarify some diagnostics as errors vs. warnings. * gettext-tools/src/x-csharp.c (phase2_getc): Clarify role of diagnostics. * gettext-tools/src/x-javascript.c (phase2_getc): Likewise. * gettext-tools/src/x-perl.c (get_here_document, extract_balanced): Likewise. * gettext-tools/src/x-python.c (phase2_getc): Likewise. * gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise. * gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Likewise. --- diff --git a/gettext-tools/src/x-csharp.c b/gettext-tools/src/x-csharp.c index b8a420df9..8eb29b423 100644 --- a/gettext-tools/src/x-csharp.c +++ b/gettext-tools/src/x-csharp.c @@ -316,7 +316,7 @@ Please specify the correct source encoding through --from-code.\n"), buf[bufcount++] = (unsigned char) c; } else - error (EXIT_FAILURE, errno, _("%s:%d: iconv failure"), + error (EXIT_FAILURE, errno, _("%s:%d: error: iconv failure"), real_file_name, line_number); } else diff --git a/gettext-tools/src/x-javascript.c b/gettext-tools/src/x-javascript.c index f0452a07c..26dcd4fb5 100644 --- a/gettext-tools/src/x-javascript.c +++ b/gettext-tools/src/x-javascript.c @@ -328,7 +328,7 @@ Please specify the correct source encoding through --from-code\n"), buf[bufcount++] = (unsigned char) c; } else - error (EXIT_FAILURE, errno, _("%s:%d: iconv failure"), + error (EXIT_FAILURE, errno, _("%s:%d: error: iconv failure"), real_file_name, line_number); } else diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index 7f2e93ff4..ee24e1ebb 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -339,7 +339,7 @@ get_here_document (const char *delimiter) { error_with_progname = false; error (EXIT_SUCCESS, 0, - _("%s:%d: can't find string terminator \"%s\" anywhere before EOF"), + _("%s:%d: warning: can't find string terminator \"%s\" anywhere before EOF"), real_file_name, line_number, delimiter); error_with_progname = true; @@ -3715,7 +3715,7 @@ extract_balanced (message_list_ty *mlp, break; default: - fprintf (stderr, "%s:%d: unknown token type %d\n", + fprintf (stderr, "%s:%d: error: unknown token type %d\n", real_file_name, tp->line_number, (int) tp->type); abort (); } diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c index dacc2c858..6dc5ed631 100644 --- a/gettext-tools/src/x-python.c +++ b/gettext-tools/src/x-python.c @@ -355,7 +355,7 @@ comment as specified in https://www.python.org/peps/pep-0263.html.\n"), buf[bufcount++] = (unsigned char) c; } else - error (EXIT_FAILURE, errno, _("%s:%d: iconv failure"), + error (EXIT_FAILURE, errno, _("%s:%d: error: iconv failure"), real_file_name, line_number); } else diff --git a/gettext-tools/src/x-rst.c b/gettext-tools/src/x-rst.c index cde1ee6c0..ea67faf0e 100644 --- a/gettext-tools/src/x-rst.c +++ b/gettext-tools/src/x-rst.c @@ -1,5 +1,5 @@ /* xgettext RST/RSJ backend. - Copyright (C) 2001-2003, 2005-2009, 2018-2019 Free Software Foundation, Inc. + Copyright (C) 2001-2023 Free Software Foundation, Inc. This file was written by Bruno Haible , 2001. @@ -113,7 +113,7 @@ extract_rst (FILE *f, if (c == EOF || c == '\n') { error_with_progname = false; - error (EXIT_FAILURE, 0, _("%s:%d: invalid string definition"), + error (EXIT_FAILURE, 0, _("%s:%d: error: invalid string definition"), logical_filename, line_number); error_with_progname = true; } @@ -177,7 +177,7 @@ extract_rst (FILE *f, if (c == EOF || !c_isdigit (c)) { error_with_progname = false; - error (EXIT_FAILURE, 0, _("%s:%d: missing number after #"), + error (EXIT_FAILURE, 0, _("%s:%d: error: missing number after #"), logical_filename, line_number); error_with_progname = true; } @@ -212,7 +212,7 @@ extract_rst (FILE *f, else { error_with_progname = false; - error (EXIT_FAILURE, 0, _("%s:%d: invalid string expression"), + error (EXIT_FAILURE, 0, _("%s:%d: error: invalid string expression"), logical_filename, line_number); error_with_progname = true; } @@ -674,14 +674,14 @@ extract_rsj (FILE *f, invalid_json: error_with_progname = false; - error (EXIT_FAILURE, 0, _("%s:%d: invalid JSON syntax"), + error (EXIT_FAILURE, 0, _("%s:%d: error: invalid JSON syntax"), logical_filename, line_number); error_with_progname = true; return; invalid_rsj: error_with_progname = false; - error (EXIT_FAILURE, 0, _("%s:%d: invalid RSJ syntax"), + error (EXIT_FAILURE, 0, _("%s:%d: error: invalid RSJ syntax"), logical_filename, line_number); error_with_progname = true; return; @@ -689,7 +689,7 @@ extract_rsj (FILE *f, invalid_rsj_version: error_with_progname = false; error (EXIT_FAILURE, 0, - _("%s:%d: invalid RSJ version. Only version 1 is supported."), + _("%s:%d: error: invalid RSJ version. Only version 1 is supported."), logical_filename, line_number); error_with_progname = true; return; diff --git a/gettext-tools/src/xg-arglist-parser.c b/gettext-tools/src/xg-arglist-parser.c index 56e197d96..b5bf26c59 100644 --- a/gettext-tools/src/xg-arglist-parser.c +++ b/gettext-tools/src/xg-arglist-parser.c @@ -385,7 +385,7 @@ arglist_parser_done (struct arglist_parser *ap, int argnum) error_at_line (0, 0, best_cp->msgid_pos.file_name, best_cp->msgid_pos.line_number, - _("ambiguous argument specification for keyword '%.*s'"), + _("warning: ambiguous argument specification for keyword '%.*s'"), (int) ap->keyword_len, ap->keyword); error_with_progname = true; } @@ -493,7 +493,7 @@ arglist_parser_done (struct arglist_parser *ap, int argnum) error_at_line (0, 0, best_cp->msgid_plural_pos.file_name, best_cp->msgid_plural_pos.line_number, - _("context mismatch between singular and plural form")); + _("warning: context mismatch between singular and plural form")); error_with_progname = true; } free (ctxt);