]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Clarify some diagnostics as errors vs. warnings.
authorBruno Haible <bruno@clisp.org>
Thu, 5 Oct 2023 06:20:50 +0000 (08:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Oct 2023 12:55:58 +0000 (14:55 +0200)
* 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.

gettext-tools/src/x-csharp.c
gettext-tools/src/x-javascript.c
gettext-tools/src/x-perl.c
gettext-tools/src/x-python.c
gettext-tools/src/x-rst.c
gettext-tools/src/xg-arglist-parser.c

index b8a420df9b928dd164799b65b3fd81b15a1f7e79..8eb29b423fe3e8407c4fabd9b320b17d4463ee05 100644 (file)
@@ -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
index f0452a07c1cdf77ad05a467b84fd18a6cea76cc0..26dcd4fb52c869b35b1a210f3729bd6925a96c7b 100644 (file)
@@ -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
index 7f2e93ff47dc0dac228c6e6e692ef25aa03fc4d8..ee24e1ebb80bb454d01319427093726645fdb75e 100644 (file)
@@ -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 ();
             }
index dacc2c8581c864f33713c61d4de2d76bac2a9d3d..6dc5ed631da94dbcf33ac8038a9b2c6e8b9a7a97 100644 (file)
@@ -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
index cde1ee6c024abc7c3c20868902e72d964363cb71..ea67faf0e9a2026ad06aff46f495e98ef709cc6c 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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;
index 56e197d9623c0942dfc73f9ef14bd52be39259c1..b5bf26c5900d76a7c84763be0e9813f663c95555 100644 (file)
@@ -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);