]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and...
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Jun 2005 19:21:03 +0000 (21:21 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 6 Jun 2005 19:21:03 +0000 (21:21 +0200)
gcc/po/
* exgettext: Handle gmsgid and cmsgid arguments specially,
as gcc-internal-format and c-format.  Because of xgettext
bug, invoke xgettext once with --language=c, once with
--language=GCC-source and then merge together.  Fail if
xgettext is not 0.14.5 or later.
gcc/
* intl.h (G_): New macro.
* rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid
instead of msgid for argument name.
* tree-ssa.c (warn_uninit): Likewise.
* config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise.
* config/darwin-c.c (BAD): Likewise.
* config/c4x/c4x-c.c (BAD): Likewise.
* c-pragma.c (GCC_BAD, GCC_BAD2): Likewise.
* c-errors.c (pedwarn_c99, pedwarn_c90): Likewise.
* c-common.c (c_parse_error): Likewise.
* diagnostic.c (diagnostic_set_info, verbatim, inform, warning,
pedwarn, error, sorry, fatal_error, internal_error): Likewise.
(fnotice): Use cmsgid instead of msgid for argument name.
* gcov.c (fnotice): Likewise.
* protoize.c (notice): Likewise.
* final.c (output_operand_lossage): Likewise.
* gcc.c (fatal, notice): Likewise.
(error): Use gmsgid instead of msgid for argument name.
* collect2.c (notice, fatal_perror, fatal): Use cmsgid instead
of msgid for argument name.
(error): Use gmsgid instead of msgid for argument name.
* c-decl.c (locate_old_decl, implicit_decl_warning): Use G_()
instead of N_().
* c-typeck.c (readonly_error, convert_for_assignment): Likewise.
* tree-inline.c (inline_forbidden_p_1): Likewise.
* ABOUT-GCC-NLS: Require gettext 0.14.5 or later.  Mention the new
conventions for marking translations.
* doc/install.texi: Mention gettext 0.14.5 or later requirement.
gcc/cp/
* error.c (locate_error): Use gmsgid instead of msgid for argument
name.
(cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
gcc/java/
* jv-scan.c (fatal_error, warning): Use gmsgid instead of msgid for
argument name.
* gjavah.c (error): Likewise.
* java-tree.h (parse_error_context): Likewise.
* parse.y (parse_error_context, parse_warning_context,
issue_warning_error_from_context): Likewise.

From-SVN: r100672

30 files changed:
gcc/ABOUT-GCC-NLS
gcc/ChangeLog
gcc/c-common.c
gcc/c-decl.c
gcc/c-errors.c
gcc/c-pragma.c
gcc/c-typeck.c
gcc/collect2.c
gcc/config/c4x/c4x-c.c
gcc/config/darwin-c.c
gcc/config/rs6000/rs6000-c.c
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/diagnostic.c
gcc/doc/install.texi
gcc/final.c
gcc/gcc.c
gcc/gcov.c
gcc/intl.h
gcc/java/ChangeLog
gcc/java/gjavah.c
gcc/java/java-tree.h
gcc/java/jv-scan.c
gcc/java/parse.y
gcc/po/ChangeLog
gcc/po/exgettext
gcc/protoize.c
gcc/rtl-error.c
gcc/tree-inline.c
gcc/tree-ssa.c

index b0919d1b2ac761dd8cf3f45cd2d6fb7fa3da30cb..8107d583e0775c258eede3b9f5776dccf3172196 100644 (file)
@@ -25,15 +25,22 @@ responsibility to translate the message before the user sees it.
 
 By convention, any function parameter in the GCC sources whose name
 ends in `msgid' is expected to be a message requiring translation.
-For example, the `error' function's first parameter is named `msgid'.
+If the parameter name ends with `gmsgid', it is assumed to be a GCC
+diagnostics format string requiring translation, if it ends with
+`cmsgid', it is assumed to be a format string for `printf' family
+of functions, requiring a translation.
+For example, the `error' function's first parameter is named `gmsgid'.
 GCC's exgettext script uses this convention to determine which
 function parameter strings need to be translated.  The exgettext
 script also assumes that any occurrence of `%eMSGID}' on a source
 line, where MSGID does not contain `%' or `}', corresponds to a
 message MSGID that requires translation; this is needed to identify
 diagnostics in GCC spec strings.
+The `G_(GMSGID)' macro defined in intl.h can be used to mark GCC diagnostics
+format strings as requiring translation, but other than that it is a
+no-op at runtime.
 
-If you modify source files, you'll need at least version 0.10.37 of the
+If you modify source files, you'll need at least version 0.14.15 of the
 GNU gettext package to propagate the modifications to the translation
 tables.
 
index 4e3c714e9ceeb14adcaff865d587432b730b1f68..387adfdc628e509b2a1c97f5a351e62a34c3f57d 100644 (file)
@@ -1,3 +1,34 @@
+2005-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * intl.h (G_): New macro.
+       * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid
+       instead of msgid for argument name.
+       * tree-ssa.c (warn_uninit): Likewise.
+       * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise.
+       * config/darwin-c.c (BAD): Likewise.
+       * config/c4x/c4x-c.c (BAD): Likewise.
+       * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise.
+       * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise.
+       * c-common.c (c_parse_error): Likewise.
+       * diagnostic.c (diagnostic_set_info, verbatim, inform, warning,
+       pedwarn, error, sorry, fatal_error, internal_error): Likewise.
+       (fnotice): Use cmsgid instead of msgid for argument name.
+       * gcov.c (fnotice): Likewise.
+       * protoize.c (notice): Likewise.
+       * final.c (output_operand_lossage): Likewise.
+       * gcc.c (fatal, notice): Likewise.
+       (error): Use gmsgid instead of msgid for argument name.
+       * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead
+       of msgid for argument name.
+       (error): Use gmsgid instead of msgid for argument name.
+       * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_()
+       instead of N_().
+       * c-typeck.c (readonly_error, convert_for_assignment): Likewise.
+       * tree-inline.c (inline_forbidden_p_1): Likewise.
+       * ABOUT-GCC-NLS: Require gettext 0.14.5 or later.  Mention the new
+       conventions for marking translations.
+       * doc/install.texi: Mention gettext 0.14.5 or later requirement.
+
 2005-06-06  Sebastian Pop <pop@cri.ensmp.fr>
 
        PR tree-optimization/20742
index 626c3eacefc1aa03e659c22e3768c739cf8e3bfb..0c2a676b80df4c0f1f2f2931f4dfa9e6e61603b3 100644 (file)
@@ -5519,51 +5519,51 @@ catenate_strings (const char *lhs, const char *rhs_start, int rhs_size)
   return result;
 }
 
-/* Issue the error given by MSGID, indicating that it occurred before
+/* Issue the error given by GMSGID, indicating that it occurred before
    TOKEN, which had the associated VALUE.  */
 
 void
-c_parse_error (const char *msgid, enum cpp_ttype token, tree value)
+c_parse_error (const char *gmsgid, enum cpp_ttype token, tree value)
 {
 #define catenate_messages(M1, M2) catenate_strings ((M1), (M2), sizeof (M2))
 
   char *message = NULL;
 
   if (token == CPP_EOF)
-    message = catenate_messages (msgid, " at end of input");
+    message = catenate_messages (gmsgid, " at end of input");
   else if (token == CPP_CHAR || token == CPP_WCHAR)
     {
       unsigned int val = TREE_INT_CST_LOW (value);
       const char *const ell = (token == CPP_CHAR) ? "" : "L";
       if (val <= UCHAR_MAX && ISGRAPH (val))
-        message = catenate_messages (msgid, " before %s'%c'");
+        message = catenate_messages (gmsgid, " before %s'%c'");
       else
-        message = catenate_messages (msgid, " before %s'\\x%x'");
+        message = catenate_messages (gmsgid, " before %s'\\x%x'");
 
       error (message, ell, val);
       free (message);
       message = NULL;
     }
   else if (token == CPP_STRING || token == CPP_WSTRING)
-    message = catenate_messages (msgid, " before string constant");
+    message = catenate_messages (gmsgid, " before string constant");
   else if (token == CPP_NUMBER)
-    message = catenate_messages (msgid, " before numeric constant");
+    message = catenate_messages (gmsgid, " before numeric constant");
   else if (token == CPP_NAME)
     {
-      message = catenate_messages (msgid, " before %qs");
+      message = catenate_messages (gmsgid, " before %qs");
       error (message, IDENTIFIER_POINTER (value));
       free (message);
       message = NULL;
     }
   else if (token < N_TTYPES)
     {
-      message = catenate_messages (msgid, " before %qs token");
+      message = catenate_messages (gmsgid, " before %qs token");
       error (message, cpp_type2name (token));
       free (message);
       message = NULL;
     }
   else
-    error (msgid);
+    error (gmsgid);
 
   if (message)
     {
index 618b6083f1f6de8a5b04de38bebca5acf27839f1..dabd1c145b3362b23b48c205c071afc969671c4a 100644 (file)
@@ -1114,11 +1114,11 @@ locate_old_decl (tree decl, void (*diag)(const char *, ...))
   if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
     ;
   else if (DECL_INITIAL (decl))
-    diag (N_("%Jprevious definition of %qD was here"), decl, decl);
+    diag (G_("%Jprevious definition of %qD was here"), decl, decl);
   else if (C_DECL_IMPLICIT (decl))
-    diag (N_("%Jprevious implicit declaration of %qD was here"), decl, decl);
+    diag (G_("%Jprevious implicit declaration of %qD was here"), decl, decl);
   else
-    diag (N_("%Jprevious declaration of %qD was here"), decl, decl);
+    diag (G_("%Jprevious declaration of %qD was here"), decl, decl);
 }
 
 /* Subroutine of duplicate_decls.  Compare NEWDECL to OLDDECL.
@@ -2275,7 +2275,7 @@ implicit_decl_warning (tree id, tree olddecl)
     default: gcc_unreachable ();
     }
 
-  diag (N_("implicit declaration of function %qE"), id);
+  diag (G_("implicit declaration of function %qE"), id);
   if (olddecl)
     locate_old_decl (olddecl, diag);
 }
index fa71b8cfa97d92f5830e2272b6bdc121d37d954b..ccdbf7ef7cc0d341538e8717d9615b05905aca7b 100644 (file)
@@ -32,13 +32,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 /* Issue an ISO C99 pedantic warning MSGID.  */
 
 void
-pedwarn_c99 (const char *msgid, ...)
+pedwarn_c99 (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
   
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
                        flag_isoc99 ? pedantic_error_kind () : DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
@@ -50,13 +50,13 @@ pedwarn_c99 (const char *msgid, ...)
    (There is no flag_c90.)  */
 
 void
-pedwarn_c90 (const char *msgid, ...)
+pedwarn_c90 (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
                        flag_isoc99 ? DK_WARNING : pedantic_error_kind ());
   report_diagnostic (&diagnostic);
   va_end (ap);
index cc1dd280359a59c7e3855c5b3857429426bf4c3b..67fe8d2d85640b19369e2ed3a4a927282b757140 100644 (file)
@@ -36,8 +36,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "tm_p.h"
 #include "target.h"
 
-#define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
-#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
+#define GCC_BAD(gmsgid) do { warning (gmsgid); return; } while (0)
+#define GCC_BAD2(gmsgid, arg) \
+  do { warning (gmsgid, arg); return; } while (0)
 
 typedef struct align_stack GTY(())
 {
index acc0127107c397c047439d5da6316bfdb2ed8208..e30e216122b7f34b32aea5590774064ebd9791d7 100644 (file)
@@ -2814,20 +2814,20 @@ readonly_error (tree arg, enum lvalue_use use)
       if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
        readonly_error (TREE_OPERAND (arg, 0), use);
       else
-       error (READONLY_MSG (N_("assignment of read-only member %qs"),
-                            N_("increment of read-only member %qs"),
-                            N_("decrement of read-only member %qs")),
+       error (READONLY_MSG (G_("assignment of read-only member %qs"),
+                            G_("increment of read-only member %qs"),
+                            G_("decrement of read-only member %qs")),
               IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
     }
   else if (TREE_CODE (arg) == VAR_DECL)
-    error (READONLY_MSG (N_("assignment of read-only variable %qs"),
-                        N_("increment of read-only variable %qs"),
-                        N_("decrement of read-only variable %qs")),
+    error (READONLY_MSG (G_("assignment of read-only variable %qs"),
+                        G_("increment of read-only variable %qs"),
+                        G_("decrement of read-only variable %qs")),
           IDENTIFIER_POINTER (DECL_NAME (arg)));
   else
-    error (READONLY_MSG (N_("assignment of read-only location"),
-                        N_("increment of read-only location"),
-                        N_("decrement of read-only location")));
+    error (READONLY_MSG (G_("assignment of read-only location"),
+                        G_("increment of read-only location"),
+                        G_("decrement of read-only location")));
 }
 \f
 /* Mark EXP saying that we need to be able to take the
@@ -3662,26 +3662,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
                     function where an ordinary one is wanted, but not
                     vice-versa.  */
                  if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
-                   WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE "
+                   WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE "
                                            "makes qualified function "
                                            "pointer from unqualified"),
-                                        N_("assignment makes qualified "
+                                        G_("assignment makes qualified "
                                            "function pointer from "
                                            "unqualified"),
-                                        N_("initialization makes qualified "
+                                        G_("initialization makes qualified "
                                            "function pointer from "
                                            "unqualified"),
-                                        N_("return makes qualified function "
+                                        G_("return makes qualified function "
                                            "pointer from unqualified"));
                }
              else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
-               WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE discards "
+               WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
                                        "qualifiers from pointer target type"),
-                                    N_("assignment discards qualifiers "
+                                    G_("assignment discards qualifiers "
                                        "from pointer target type"),
-                                    N_("initialization discards qualifiers "
+                                    G_("initialization discards qualifiers "
                                        "from pointer target type"),
-                                    N_("return discards qualifiers from "
+                                    G_("return discards qualifiers from "
                                        "pointer target type"));
            }
 
@@ -3730,14 +3730,14 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
                      which are not ANSI null ptr constants.  */
                   && (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR)
                   && TREE_CODE (ttl) == FUNCTION_TYPE)))
-           WARN_FOR_ASSIGNMENT (N_("ISO C forbids passing argument %d of "
+           WARN_FOR_ASSIGNMENT (G_("ISO C forbids passing argument %d of "
                                    "%qE between function pointer "
                                    "and %<void *%>"),
-                                N_("ISO C forbids assignment between "
+                                G_("ISO C forbids assignment between "
                                    "function pointer and %<void *%>"),
-                                N_("ISO C forbids initialization between "
+                                G_("ISO C forbids initialization between "
                                    "function pointer and %<void *%>"),
-                                N_("ISO C forbids return between function "
+                                G_("ISO C forbids return between function "
                                    "pointer and %<void *%>"));
          /* Const and volatile mean something different for function types,
             so the usual warnings are not appropriate.  */
@@ -3745,13 +3745,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
                   && TREE_CODE (ttl) != FUNCTION_TYPE)
            {
              if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
-               WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE discards "
+               WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
                                        "qualifiers from pointer target type"),
-                                    N_("assignment discards qualifiers "
+                                    G_("assignment discards qualifiers "
                                        "from pointer target type"),
-                                    N_("initialization discards qualifiers "
+                                    G_("initialization discards qualifiers "
                                        "from pointer target type"),
-                                    N_("return discards qualifiers from "
+                                    G_("return discards qualifiers from "
                                        "pointer target type"));
              /* If this is not a case of ignoring a mismatch in signedness,
                 no warning.  */
@@ -3760,13 +3760,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
                ;
              /* If there is a mismatch, do warn.  */
              else if (warn_pointer_sign)
-               WARN_FOR_ASSIGNMENT (N_("pointer targets in passing argument "
+               WARN_FOR_ASSIGNMENT (G_("pointer targets in passing argument "
                                        "%d of %qE differ in signedness"),
-                                    N_("pointer targets in assignment "
+                                    G_("pointer targets in assignment "
                                        "differ in signedness"),
-                                    N_("pointer targets in initialization "
+                                    G_("pointer targets in initialization "
                                        "differ in signedness"),
-                                    N_("pointer targets in return differ "
+                                    G_("pointer targets in return differ "
                                        "in signedness"));
            }
          else if (TREE_CODE (ttl) == FUNCTION_TYPE
@@ -3777,24 +3777,24 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
                 it is okay to use a const or volatile function
                 where an ordinary one is wanted, but not vice-versa.  */
              if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
-               WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes "
+               WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
                                        "qualified function pointer "
                                        "from unqualified"),
-                                    N_("assignment makes qualified function "
+                                    G_("assignment makes qualified function "
                                        "pointer from unqualified"),
-                                    N_("initialization makes qualified "
+                                    G_("initialization makes qualified "
                                        "function pointer from unqualified"),
-                                    N_("return makes qualified function "
+                                    G_("return makes qualified function "
                                        "pointer from unqualified"));
            }
        }
       else
-       WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE from "
+       WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE from "
                                "incompatible pointer type"),
-                            N_("assignment from incompatible pointer type"),
-                            N_("initialization from incompatible "
+                            G_("assignment from incompatible pointer type"),
+                            G_("initialization from incompatible "
                                "pointer type"),
-                            N_("return from incompatible pointer type"));
+                            G_("return from incompatible pointer type"));
       return convert (type, rhs);
     }
   else if (codel == POINTER_TYPE && coder == ARRAY_TYPE)
@@ -3815,26 +3815,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
            && TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE
            && TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST
            && integer_zerop (TREE_OPERAND (rhs, 0))))
-       WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes "
+       WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
                                "pointer from integer without a cast"),
-                            N_("assignment makes pointer from integer "
+                            G_("assignment makes pointer from integer "
                                "without a cast"),
-                            N_("initialization makes pointer from "
+                            G_("initialization makes pointer from "
                                "integer without a cast"),
-                            N_("return makes pointer from integer "
+                            G_("return makes pointer from integer "
                                "without a cast"));
 
       return convert (type, rhs);
     }
   else if (codel == INTEGER_TYPE && coder == POINTER_TYPE)
     {
-      WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes integer "
+      WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes integer "
                              "from pointer without a cast"),
-                          N_("assignment makes integer from pointer "
+                          G_("assignment makes integer from pointer "
                              "without a cast"),
-                          N_("initialization makes integer from pointer "
+                          G_("initialization makes integer from pointer "
                              "without a cast"),
-                          N_("return makes integer from pointer "
+                          G_("return makes integer from pointer "
                              "without a cast"));
       return convert (type, rhs);
     }
index 19776299befc70aa47432800930d025e7fa939d3..c05be80b7c9437853f59882139628c741248efbc 100644 (file)
@@ -337,26 +337,26 @@ collect_exit (int status)
 \f
 /* Notify user of a non-error.  */
 void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 
 /* Die when sys call fails.  */
 
 void
-fatal_perror (const char * msgid, ...)
+fatal_perror (const char * cmsgid, ...)
 {
   int e = errno;
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   fprintf (stderr, ": %s\n", xstrerror (e));
   va_end (ap);
 
@@ -366,13 +366,13 @@ fatal_perror (const char * msgid, ...)
 /* Just die.  */
 
 void
-fatal (const char * msgid, ...)
+fatal (const char * cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   fprintf (stderr, "\n");
   va_end (ap);
 
@@ -382,13 +382,13 @@ fatal (const char * msgid, ...)
 /* Write error message.  */
 
 void
-error (const char * msgid, ...)
+error (const char * gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fprintf (stderr, "\n");
   va_end(ap);
 }
index 780a12b380faa226afced85ffd4f7fb32edf8bf3..699931a16388e36fdbc4b3e42c11a35817451139 100644 (file)
@@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char *, tree *, tree *);
    the STRING_CST node of the string.  If SECT is null, then this
    pragma doesn't take a section string.  Returns 0 for a good pragma,
    -1 for a malformed pragma.  */
-#define BAD(msgid, arg) do { warning (msgid, arg); return -1; } while (0)
+#define BAD(gmsgid, arg) do { warning (gmsgid, arg); return -1; } while (0)
 
 static int
 c4x_parse_pragma (name, func, sect)
index feb26f185d297721401cb8b1f7894a4aa63963ba..d7fdd73ad2b8f2bcf0d6609b34815a351782d060 100644 (file)
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Pragmas.  */
 
-#define BAD(msgid) do { warning (msgid); return; } while (0)
+#define BAD(gmsgid) do { warning (gmsgid); return; } while (0)
 
 static bool using_frameworks = false;
 
index 5d36d5d28b378d6e9b1c5484c91681e2c83db5b2..61b662a544280c566f091a1ce7000084a2a1517e 100644 (file)
@@ -41,8 +41,8 @@
    whether or not new function declarations receive a longcall
    attribute by default.  */
 
-#define SYNTAX_ERROR(msgid) do {                       \
-  warning (msgid);                                     \
+#define SYNTAX_ERROR(gmsgid) do {                      \
+  warning (gmsgid);                                    \
   warning ("ignoring malformed #pragma longcall");     \
   return;                                              \
 } while (0)
index 5af557607f0bf1d5d1966689bf14a3636e45ddbc..20931daa2a0218bfef83372630b891b05dcf8969 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * error.c (locate_error): Use gmsgid instead of msgid for argument
+       name.
+       (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
+
 2005-06-05  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/21619
index c53e0328cd01946148da5123637bc728688ec495..3039800a0935bd487195fd07860a8aa377a50ce6 100644 (file)
@@ -2319,13 +2319,13 @@ cp_printer (pretty_printer *pp, text_info *text)
    behavior of cp_*_at.  */
 
 static tree
-locate_error (const char *msgid, va_list ap)
+locate_error (const char *gmsgid, va_list ap)
 {
   tree here = 0, t;
   int plus = 0;
   const char *f;
 
-  for (f = msgid; *f; f++)
+  for (f = gmsgid; *f; f++)
     {
       plus = 0;
       if (*f == '%')
@@ -2381,57 +2381,57 @@ locate_error (const char *msgid, va_list ap)
 
 
 void
-cp_error_at (const char *msgid, ...)
+cp_error_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        input_location, DK_ERROR);
   cp_diagnostic_starter (global_dc, &diagnostic);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), DK_ERROR);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
 
 void
-cp_warning_at (const char *msgid, ...)
+cp_warning_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
 
 void
-cp_pedwarn_at (const char *msgid, ...)
+cp_pedwarn_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), pedantic_error_kind());
   report_diagnostic (&diagnostic);
   va_end (ap);
index b047167bc492086e752660a801384c5114af3e78..bce47192e42a0af40527dbdaa5e822e3825cd2ea 100644 (file)
@@ -111,13 +111,13 @@ diagnostic_initialize (diagnostic_context *context)
 }
 
 void
-diagnostic_set_info (diagnostic_info *diagnostic, const char *msgid,
+diagnostic_set_info (diagnostic_info *diagnostic, const char *gmsgid,
                     va_list *args, location_t location,
                     diagnostic_t kind)
 {
   diagnostic->message.err_no = errno;
   diagnostic->message.args_ptr = args;
-  diagnostic->message.format_spec = _(msgid);
+  diagnostic->message.format_spec = _(gmsgid);
   diagnostic->location = location;
   diagnostic->kind = kind;
 }
@@ -378,15 +378,15 @@ trim_filename (const char *name)
 /* Text to be emitted verbatim to the error message stream; this
    produces no prefix and disables line-wrapping.  Use rarely.  */
 void
-verbatim (const char *msgid, ...)
+verbatim (const char *gmsgid, ...)
 {
   text_info text;
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   text.err_no = errno;
   text.args_ptr = &ap;
-  text.format_spec = _(msgid);
+  text.format_spec = _(gmsgid);
   pp_format_verbatim (global_dc->printer, &text);
   pp_flush (global_dc->printer);
   va_end (ap);
@@ -395,13 +395,13 @@ verbatim (const char *msgid, ...)
 /* An informative note.  Use this for additional details on an error
    message.  */
 void
-inform (const char *msgid, ...)
+inform (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_NOTE);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_NOTE);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -409,13 +409,13 @@ inform (const char *msgid, ...)
 /* A warning.  Use this for code which is correct according to the
    relevant language specification but is likely to be buggy anyway.  */
 void
-warning (const char *msgid, ...)
+warning (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_WARNING);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -429,13 +429,13 @@ warning (const char *msgid, ...)
    of the -pedantic command-line switch.  To get a warning enabled
    only with that switch, write "if (pedantic) pedwarn (...);"  */
 void
-pedwarn (const char *msgid, ...)
+pedwarn (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
                       pedantic_error_kind ());
   report_diagnostic (&diagnostic);
   va_end (ap);
@@ -444,13 +444,13 @@ pedwarn (const char *msgid, ...)
 /* A hard error: the code is definitely ill-formed, and an object file
    will not be produced.  */
 void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_ERROR);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ERROR);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -459,13 +459,13 @@ error (const char *msgid, ...)
    required by the relevant specification but not implemented by GCC.
    An object file will not be produced.  */
 void
-sorry (const char *msgid, ...)
+sorry (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_SORRY);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_SORRY);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -474,13 +474,13 @@ sorry (const char *msgid, ...)
    continue.  Do not use this for internal consistency checks; that's
    internal_error.  Use of this function should be rare.  */
 void
-fatal_error (const char *msgid, ...)
+fatal_error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_FATAL);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_FATAL);
   report_diagnostic (&diagnostic);
   va_end (ap);
 
@@ -492,13 +492,13 @@ fatal_error (const char *msgid, ...)
    a more specific message, or some other good reason, you should use
    abort () instead of calling this function directly.  */
 void
-internal_error (const char *msgid, ...)
+internal_error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_ICE);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ICE);
   report_diagnostic (&diagnostic);
   va_end (ap);
 
@@ -511,12 +511,12 @@ internal_error (const char *msgid, ...)
 /* Print a diagnostic MSGID on FILE.  This is just fprintf, except it
    runs its second argument through gettext.  */
 void
-fnotice (FILE *file, const char *msgid, ...)
+fnotice (FILE *file, const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (file, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (file, _(cmsgid), ap);
   va_end (ap);
 }
 
index ed2aadf3132a80d34d22ab4ec6ea5e16bec39595..37b4c8d1757660c62de7736a5b683820e29af7e9 100644 (file)
@@ -328,7 +328,7 @@ the 1.9.x series, which is currently 1.9.3.  When regenerating a directory
 to a newer version, please update all the directories using an older 1.9.x
 to the latest released version.
 
-@item gettext version 0.12 (or later)
+@item gettext version 0.14.5 (or later)
 
 Needed to regenerate @file{gcc.pot}.
 
index 213ab5f7450d5f8dd251ffce459306af17b5bdb6..1b4b2a5bc3fba815c61416de7bc0aba8f6959a2a 100644 (file)
@@ -2845,17 +2845,17 @@ alter_cond (rtx cond)
    In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
 
 void
-output_operand_lossage (const char *msgid, ...)
+output_operand_lossage (const char *cmsgid, ...)
 {
   char *fmt_string;
   char *new_message;
   const char *pfx_str;
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
 
   pfx_str = this_is_asm_operands ? _("invalid 'asm': ") : "output_operand: ";
-  asprintf (&fmt_string, "%s%s", pfx_str, _(msgid));
+  asprintf (&fmt_string, "%s%s", pfx_str, _(cmsgid));
   vasprintf (&new_message, fmt_string, ap);
 
   if (this_is_asm_operands)
index 13c451a28c5230a893ce0e0e65ffbe820eef3c3f..e696b28d8a8c74ab11e33d9d4d124dd80636a9c6 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -6739,40 +6739,46 @@ fancy_abort (const char *file, int line, const char *func)
 /* Output an error message and exit.  */
 
 void
-fatal (const char *msgid, ...)
+fatal (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
 
   fprintf (stderr, "%s: ", programname);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
   fprintf (stderr, "\n");
   delete_temp_files ();
   exit (1);
 }
 
+/* The argument is actually c-format, not gcc-internal-format,
+   but because functions with identical names are used through
+   the rest of the compiler with gcc-internal-format, we just
+   need to hope all users of these functions use the common
+   subset between c-format and gcc-internal-format.  */
+
 void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, "%s: ", programname);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   va_end (ap);
 
   fprintf (stderr, "\n");
 }
 
 static void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 \f
index 5f094cdc24468ca79591b259da93912c7333d98d..d92e81c49a91f93232b98c230fb93fa73c5d0e86 100644 (file)
@@ -367,12 +367,12 @@ main (int argc, char **argv)
 }
 
 static void
-fnotice (FILE *file, const char *msgid, ...)
+fnotice (FILE *file, const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (file, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (file, _(cmsgid), ap);
   va_end (ap);
 }
 \f
index 1166794ed741f779a3316dbe19fb74f29da5a7d1..cca596d984d135a4f6b7371bfb468016d21c7776 100644 (file)
@@ -51,6 +51,10 @@ extern size_t gcc_gettext_width (const char *);
 # define N_(msgid) msgid
 #endif
 
+#ifndef G_
+# define G_(gmsgid) gmsgid
+#endif
+
 extern const char *open_quote;
 extern const char *close_quote;
 
index 43026df20e1d82bebb46822815363516f6ae6469..b074527a467f6324c1d8b4123568b0b86359a374 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * jv-scan.c (fatal_error, warning): Use gmsgid instead of msgid for
+       argument name.
+       * gjavah.c (error): Likewise.
+       * java-tree.h (parse_error_context): Likewise.
+       * parse.y (parse_error_context, parse_warning_context,
+       issue_warning_error_from_context): Likewise.
+
 2005-06-02  Tom Tromey  <tromey@redhat.com>
 
        PR java/21722:
index 7f0d2b14bb3161eb471152462b5e2d7ebf6f4bb6..103e9490f965962109bdffa1098327f6a25175ad 100644 (file)
@@ -164,7 +164,7 @@ static const unsigned char *
   decode_signature_piece (FILE *, const unsigned char *,
                          const unsigned char *, int *);
 static void print_class_decls (FILE *, JCF *, int);
-static void error (const char *msgid, ...);
+static void error (const char *gmsgid, ...);
 static void usage (void) ATTRIBUTE_NORETURN;
 static void help (void) ATTRIBUTE_NORETURN;
 static void version (void) ATTRIBUTE_NORETURN;
@@ -266,16 +266,19 @@ static int decompiled = 0;
 
 #include "jcf-reader.c"
 
-/* Print an error message and set found_error.  */
+/* Print an error message and set found_error.
+   Not really gcc-internal-format message, but as error elsewhere
+   uses it, assume all users will use intersection between
+   c-format and gcc-internal-format.  */
 static void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
 
   fprintf (stderr, TOOLNAME ": ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   va_end (ap);
   fprintf (stderr, "\n");
   found_error = 1;
index 78c68c346f4d4452061370a13694e502935cd5f5..e8bfbfbbb6bf154062aff933e3722af1e5433f21 100644 (file)
@@ -1306,7 +1306,7 @@ extern tree emit_symbol_table (tree, tree, tree, tree, tree, int);
 extern void lang_init_source (int);
 extern void write_classfile (tree);
 extern char *print_int_node (tree);
-extern void parse_error_context (tree cl, const char *msgid, ...);
+extern void parse_error_context (tree cl, const char *gmsgid, ...);
 extern void finish_class (void);
 extern void java_layout_seen_class_methods (void);
 extern void check_for_initialization (tree, tree);
index 34415aeda98737c886996364d13d7af03bf535dd..b39ecfecddc46f38dccb55f19ec9cce440c97f9a 100644 (file)
@@ -40,9 +40,9 @@ Boston, MA 02111-1307, USA.  */
 
 #include <getopt.h>
 
-extern void fatal_error (const char *msgid, ...)
+extern void fatal_error (const char *gmsgid, ...)
      ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-void warning (const char *msgid, ...) ATTRIBUTE_PRINTF_1;
+void warning (const char *gmsgid, ...) ATTRIBUTE_PRINTF_1;
 void report (void);
 
 static void usage (void) ATTRIBUTE_NORETURN;
@@ -244,27 +244,29 @@ main (int argc, char **argv)
 \f
 
 /* Error report, memory, obstack initialization and other utility
-   functions */
+   functions.  Use actually c-format msgid, but as functions with
+   the same name elsewhere use gcc-internal-format, assume all users
+   here use intersection between c-format and gcc-internal-format.  */
 
 void
-fatal_error (const char *msgid, ...)
+fatal_error (const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, _("%s: error: "), exec_name);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fputc ('\n', stderr);
   va_end (ap);
   exit (1);
 }
 
 void
-warning (const char *msgid, ...)
+warning (const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, _("%s: warning: "), exec_name);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fputc ('\n', stderr);
   va_end (ap);
 }
index cc30c8e97563855b5257ef64fd25dc2e3ae73195..e0abe7e8dc323051d0c947737d954db92c49286a 100644 (file)
@@ -97,13 +97,13 @@ static tree lookup_java_method2 (tree, tree, int);
 static tree method_header (int, tree, tree, tree);
 static void fix_method_argument_names (tree ,tree);
 static tree method_declarator (tree, tree);
-static void parse_warning_context (tree cl, const char *msgid, ...);
+static void parse_warning_context (tree cl, const char *gmsgid, ...);
 #ifdef USE_MAPPED_LOCATION
 static void issue_warning_error_from_context
-  (source_location, const char *msgid, va_list *);
+  (source_location, const char *gmsgid, va_list *);
 #else
 static void issue_warning_error_from_context
-  (tree, const char *msgid, va_list *);
+  (tree, const char *gmsgid, va_list *);
 #endif
 static void parse_ctor_invocation_error (void);
 static tree parse_jdk1_1_error (const char *);
@@ -3140,7 +3140,7 @@ issue_warning_error_from_context (
 #else
                                  tree cl,
 #endif
-                                 const char *msgid, va_list *ap)
+                                 const char *gmsgid, va_list *ap)
 {
 #ifdef USE_MAPPED_LOCATION
   source_location saved_location = input_location;
@@ -3154,7 +3154,7 @@ issue_warning_error_from_context (
 
   text.err_no = errno;
   text.args_ptr = ap;
-  text.format_spec = msgid;
+  text.format_spec = gmsgid;
   pp_format_text (global_dc->printer, &text);
   strncpy (buffer, pp_formatted_text (global_dc->printer), sizeof (buffer) - 1);
   buffer[sizeof (buffer) - 1] = '\0';
@@ -3196,14 +3196,14 @@ issue_warning_error_from_context (
    FUTURE/FIXME:  change cl to be a source_location. */
 
 void
-parse_error_context (tree cl, const char *msgid, ...)
+parse_error_context (tree cl, const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
 #ifdef USE_MAPPED_LOCATION
-  issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, &ap);
+  issue_warning_error_from_context (EXPR_LOCATION (cl), gmsgid, &ap);
 #else
-  issue_warning_error_from_context (cl, msgid, &ap);
+  issue_warning_error_from_context (cl, gmsgid, &ap);
 #endif
   va_end (ap);
 }
@@ -3212,16 +3212,16 @@ parse_error_context (tree cl, const char *msgid, ...)
    FUTURE/FIXME:  change cl to be a source_location. */
 
 static void
-parse_warning_context (tree cl, const char *msgid, ...)
+parse_warning_context (tree cl, const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
 
   do_warning = 1;
 #ifdef USE_MAPPED_LOCATION
-  issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, &ap);
+  issue_warning_error_from_context (EXPR_LOCATION (cl), gmsgid, &ap);
 #else
-  issue_warning_error_from_context (cl, msgid, &ap);
+  issue_warning_error_from_context (cl, gmsgid, &ap);
 #endif
   do_warning = 0;
   va_end (ap);
index f071a2c400c013c2f52cb7d403649afc278f1ccb..5babed326f63a62d663846d12c56ee0c1f84e2ee 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * exgettext: Handle gmsgid and cmsgid arguments specially,
+       as gcc-internal-format and c-format.  Because of xgettext
+       bug, invoke xgettext once with --language=c, once with
+       --language=GCC-source and then merge together.  Fail if
+       xgettext is not 0.14.5 or later.
+
 2005-05-31  Joseph S. Myers  <joseph@codesourcery.com>
 
        * sv.po: Update.
index 0aa22ef85378a0e85c0b12867b914c22932b6069..7ea0e8c6e5e4fc44d1cb6f6b31aaa3882cf43ae0 100644 (file)
@@ -43,6 +43,12 @@ xgettext=$1
 package=$2
 srcdir=$3
 
+case `$xgettext --version | sed -e 1q | sed -e 's/^\([^0-9]*\)//'` in
+  0.14.[5-9]* | 0.14.[1-9][0-9]* | 0.1[5-9]* | 0.[2-9][0-9]* | [1-9].*) : ;;
+  *) echo "$xgettext is too old.  GNU xgettext 0.14.5 is required"
+     exit 1 ;;
+esac
+
 nl='
 '
 
@@ -55,8 +61,12 @@ trap "rm -r $T" 0
 
 pwd=`${PWDCMD-pwd}`
 kopt=$pwd/$T/keyword-options
+kopt2=$pwd/$T/keyword2-options
 emsg=$pwd/$T/emsgids.c
 posr=$pwd/$T/po-sources
+pottmp1=$pwd/$T/tmp1.pot
+pottmp2=$pwd/$T/tmp2.pot
+pottmp=$pwd/$T/tmp.pot
 
 # Extra files to scan
 extra_files=$pwd/options.c
@@ -85,7 +95,7 @@ echo "scanning for keywords and %e strings..." >&2
     done;
     echo $extra_files;
   } | tr ' ' "$nl" | grep -v '\*' |
-  $AWK -v excl=po/EXCLUDES -v posr=$posr -v kopt=$kopt -v emsg=$emsg '
+  $AWK -v excl=po/EXCLUDES -v posr=$posr -v kopt=$kopt -v kopt2=$kopt2 -v emsg=$emsg '
 function keyword_option(line) {
     paren_index = index(line, "(")
     name = substr(line, 1, paren_index - 1)
@@ -99,12 +109,28 @@ function keyword_option(line) {
     for (n = 1; sub(/^[^,]*,/, "", args); n++) {
        continue
     }
+    format=""
+    if (args ~ /g$/)
+       format="gcc-internal-format"
+    else if (args ~ /c$/)
+       format="c-format"
+
+    if (n == 1) { keyword = "--keyword=" name }
+    else { keyword = "--keyword=" name ":" n }
+    if (format) {
+        keyword=keyword "\n--flag=" name ":" n ":" format
+    }
 
-    if (n == 1) { keyword = name }
-    else        { keyword = name ":" n }
-
-    if (! keyword_seen[keyword]++) {
-       print "--keyword=" keyword > kopt
+    if (! keyword_seen[name]) {
+       if (format == "gcc-internal-format")
+               print keyword > kopt2
+       else
+               print keyword > kopt
+       keyword_seen[name] = keyword
+    } else if (keyword_seen[name] != keyword) {
+       printf("%s used incompatibly as both %s and %s\n",
+              name, keyword_seen[name], keyword)
+       exit (1)
     }
 }
 
@@ -159,7 +185,7 @@ END {
     }
     print emsg > posr
 }'
-)
+) || exit
 
 # Run the xgettext command, with temporary added as a file to scan.
 echo "running xgettext..." >&2
@@ -167,7 +193,16 @@ $xgettext --default-domain=$package --directory=$srcdir \
          --add-comments `cat $kopt` --files-from=$posr \
          --copyright-holder="Free Software Foundation, Inc." \
          --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
-         --language=c -o po/$package.pot.tmp
+         --language=c -o $pottmp1
+$xgettext --default-domain=$package --directory=$srcdir \
+         --add-comments --keyword= `cat $kopt2` --files-from=$posr \
+         --copyright-holder="Free Software Foundation, Inc." \
+         --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
+         --language=GCC-source -o $pottmp2
+$xgettext --default-domain=$package \
+         --add-comments $pottmp1 $pottmp2 \
+         --copyright-holder="Free Software Foundation, Inc." \
+         --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
+         --language=PO -o $pottmp
 # Remove local paths from .pot file.
-sed "s:$srcdir/::g;s:$pwd/::g;" <po/$package.pot.tmp >po/$package.pot
-rm po/$package.pot.tmp
+sed "s:$srcdir/::g;s:$pwd/::g;" <$pottmp >po/$package.pot
index 47882a6eba64661b37c2a5f3c02436ffa430c718..328c648525d1769464b444ee948c5e0a3215cbc3 100644 (file)
@@ -504,12 +504,12 @@ static char * saved_repl_write_ptr;
 \f
 /* Translate and output an error message.  */
 static void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
   
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 
index db795929e66691a879a905e621c6abd1266ee928..3521c1d361ae074604a63b341b155eccc32816c1 100644 (file)
@@ -87,22 +87,22 @@ diagnostic_for_asm (rtx insn, const char *msg, va_list *args_ptr,
 }
 
 void
-error_for_asm (rtx insn, const char *msgid, ...)
+error_for_asm (rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
+  va_start (ap, gmsgid);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
 void
-warning_for_asm (rtx insn, const char *msgid, ...)
+warning_for_asm (rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
+  va_start (ap, gmsgid);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING);
   va_end (ap);
 }
 
index efbba304f9d192cf8dbd2bc1122287e02e444b63..ae69853a15efab74d26ea1d78931cbc27922ef77 100644 (file)
@@ -971,7 +971,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
          && !lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
        {
          inline_forbidden_reason
-           = N_("%Jfunction %qF can never be inlined because it uses "
+           = G_("%Jfunction %qF can never be inlined because it uses "
                 "alloca (override using the always_inline attribute)");
          return node;
        }
@@ -983,7 +983,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
       if (setjmp_call_p (t))
        {
          inline_forbidden_reason
-           = N_("%Jfunction %qF can never be inlined because it uses setjmp");
+           = G_("%Jfunction %qF can never be inlined because it uses setjmp");
          return node;
        }
 
@@ -997,7 +997,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
          case BUILT_IN_NEXT_ARG:
          case BUILT_IN_VA_END:
            inline_forbidden_reason
-             = N_("%Jfunction %qF can never be inlined because it "
+             = G_("%Jfunction %qF can never be inlined because it "
                   "uses variable argument lists");
            return node;
 
@@ -1008,14 +1008,14 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
               function calling __builtin_longjmp to be inlined into the
               function calling __builtin_setjmp, Things will Go Awry.  */
            inline_forbidden_reason
-             = N_("%Jfunction %qF can never be inlined because "
+             = G_("%Jfunction %qF can never be inlined because "
                   "it uses setjmp-longjmp exception handling");
            return node;
 
          case BUILT_IN_NONLOCAL_GOTO:
            /* Similarly.  */
            inline_forbidden_reason
-             = N_("%Jfunction %qF can never be inlined because "
+             = G_("%Jfunction %qF can never be inlined because "
                   "it uses non-local goto");
            return node;
 
@@ -1026,7 +1026,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
               been inlined into.  Similarly __builtin_return would
               return from the function the inline has been inlined into.  */
            inline_forbidden_reason
-             = N_("%Jfunction %qF can never be inlined because "
+             = G_("%Jfunction %qF can never be inlined because "
                   "it uses __builtin_return or __builtin_apply_args");
            return node;
 
@@ -1045,7 +1045,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
       if (TREE_CODE (t) != LABEL_DECL)
        {
          inline_forbidden_reason
-           = N_("%Jfunction %qF can never be inlined "
+           = G_("%Jfunction %qF can never be inlined "
                 "because it contains a computed goto");
          return node;
        }
@@ -1059,7 +1059,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
             because we cannot remap the destination label used in the
             function that is performing the non-local goto.  */
          inline_forbidden_reason
-           = N_("%Jfunction %qF can never be inlined "
+           = G_("%Jfunction %qF can never be inlined "
                 "because it receives a non-local goto");
          return node;
        }
@@ -1084,7 +1084,7 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
        if (variably_modified_type_p (TREE_TYPE (t), NULL))
          {
            inline_forbidden_reason
-             = N_("%Jfunction %qF can never be inlined "
+             = G_("%Jfunction %qF can never be inlined "
                   "because it uses variable sized variables");
            return node;
          }
index 9346d6cf7065425debbaf304d132a92db5073dff..fd8003e393e364e13b800a14bbe3969195edc6fd 100644 (file)
@@ -1335,7 +1335,7 @@ struct tree_opt_pass pass_redundant_phi =
    warning text is in MSGID and LOCUS may contain a location or be null.  */
 
 static void
-warn_uninit (tree t, const char *msgid, location_t *locus)
+warn_uninit (tree t, const char *gmsgid, location_t *locus)
 {
   tree var = SSA_NAME_VAR (t);
   tree def = SSA_NAME_DEF_STMT (t);
@@ -1360,7 +1360,7 @@ warn_uninit (tree t, const char *msgid, location_t *locus)
 
   if (!locus)
     locus = &DECL_SOURCE_LOCATION (var);
-  warning (msgid, locus, var);
+  warning (gmsgid, locus, var);
   TREE_NO_WARNING (var) = 1;
 }