From 67de609c173ae1dd4c616c6f7288a696ed8d0c06 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 21 Feb 2008 00:12:44 +0000 Subject: [PATCH] Update for gcc-4.3. --- gettext-tools/src/ChangeLog | 8 ++++++++ gettext-tools/src/format-gcc-internal.c | 25 +++++++++++++++-------- gettext-tools/tests/ChangeLog | 4 ++++ gettext-tools/tests/format-gcc-internal-1 | 2 ++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 1fc68d86e..787a5b498 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,11 @@ +2008-02-20 Jakub Jelinek + Bruno Haible + + * format-gcc-internal.c: Update for GCC 4.3. + (FAT_TREE_STATEMENT): New enum item. + (format_parse): Recognize %K. + (format_print): Update. + 2008-02-04 Bruno Haible * msgmerge.c (match_domain): Remove the prev_msgid fields also from diff --git a/gettext-tools/src/format-gcc-internal.c b/gettext-tools/src/format-gcc-internal.c index 9c0295fb0..254929b85 100644 --- a/gettext-tools/src/format-gcc-internal.c +++ b/gettext-tools/src/format-gcc-internal.c @@ -1,5 +1,5 @@ /* GCC internal format strings. - Copyright (C) 2003-2007 Free Software Foundation, Inc. + Copyright (C) 2003-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -32,12 +32,12 @@ #define _(str) gettext (str) /* GCC internal format strings consist of language frontend independent - format directives, implemented in gcc-4.1.0/gcc/pretty-print.c (function + format directives, implemented in gcc-4.3.0/gcc/pretty-print.c (function pp_base_format), plus some frontend dependent extensions: - for the C/ObjC frontend - in gcc-4.1.0/gcc/c-objc-common.c (function c_tree_printer) + in gcc-4.3.0/gcc/c-objc-common.c (function c_tree_printer) - for the C++ frontend - in gcc-4.1.0/gcc/cp/error.c (function cp_printer) + in gcc-4.3.0/gcc/cp/error.c (function cp_printer) Taking these together, GCC internal format strings are specified as follows. A directive @@ -69,6 +69,7 @@ - 'p', that needs a 'void *' argument, - 'H', that needs a 'location_t *' argument, - 'J', that needs a general declaration argument, + - 'K', that needs a statement argument, [see gcc/pretty-print.c] - 'D', that needs a general declaration argument, @@ -107,11 +108,12 @@ enum format_arg_type FAT_SIZE_LONGLONG = 2 << 5, FAT_SIZE_WIDE = 3 << 5, FAT_TREE_DECL = 1 << 7, - FAT_TREE_FUNCDECL = 2 << 7, - FAT_TREE_TYPE = 3 << 7, - FAT_TREE_ARGUMENT = 4 << 7, - FAT_TREE_EXPRESSION = 5 << 7, - FAT_TREE_CV = 6 << 7, + FAT_TREE_STATEMENT = 2 << 7, + FAT_TREE_FUNCDECL = 3 << 7, + FAT_TREE_TYPE = 4 << 7, + FAT_TREE_ARGUMENT = 5 << 7, + FAT_TREE_EXPRESSION = 6 << 7, + FAT_TREE_CV = 7 << 7, FAT_TREE_CODE_BINOP = 1 << 10, FAT_TREE_CODE_ASSOP = 2 << 10, FAT_FUNCPARAM = 1 << 12, @@ -417,6 +419,8 @@ format_parse (const char *format, bool translated, char *fdi, type = FAT_LOCATION; else if (*format == 'J') type = FAT_TREE | FAT_TREE_DECL; + else if (*format == 'K') + type = FAT_TREE | FAT_TREE_STATEMENT; else { if (*format == 'D') @@ -764,6 +768,9 @@ format_print (void *descr) case FAT_TREE | FAT_TREE_DECL: printf ("D"); break; + case FAT_TREE | FAT_TREE_STATEMENT: + printf ("K"); + break; case FAT_TREE | FAT_TREE_FUNCDECL: printf ("F"); break; diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index c6dd399e5..68016a9c4 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,7 @@ +2008-02-20 Bruno Haible + + * format-gcc-internal-1: Test also %K. + 2008-02-04 Bruno Haible * msgmerge-23: New file. diff --git a/gettext-tools/tests/format-gcc-internal-1 b/gettext-tools/tests/format-gcc-internal-1 index da055e496..3bd8f35b3 100755 --- a/gettext-tools/tests/format-gcc-internal-1 +++ b/gettext-tools/tests/format-gcc-internal-1 @@ -43,6 +43,8 @@ cat <<\EOF > f-gi-1.data "abc%J" # Valid: %J with flags "%qJ" +# Valid: %K with flags +"%qK" # Valid: one pointer argument "abc%D" # Valid: one pointer argument -- 2.47.2