Summary: | aarch64: diagnostic "malformed target %s value" not translateable | ||
---|---|---|---|
Product: | gcc | Reporter: | Roland Illig <roland.illig> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sje |
Priority: | P3 | ||
Version: | 7.0 | ||
Target Milestone: | 8.0 | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79926 | ||
Host: | Target: | aarch64 | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: | Proposed patch |
Description
Roland Illig
2017-03-05 10:16:45 UTC
Same for: error ("target %s %qs is invalid", pragma_or_attr, token); Also, the word "attribute" appeared as an untranslated literal: ret = aarch64_process_target_attr (args, "attribute"); This makes it impossible to do any proper translation into any language other than English. Both pragma and attribute are keywords in the language. If the substituted value were placed in quotes, would that help? (In reply to Richard Earnshaw from comment #3) > Both pragma and attribute are keywords in the language. If the substituted > value were placed in quotes, would that help? No, it wouldn't. It would only confuse users. Imagine the following diagnostic: >> target »attribute« »__format__« is invalid Although "attribute" and "pragma" are both keywords in the language, they are not used as such in this diagnostic. Rather, they form part of the normal sentence structure. Same for all occurrences of the »pragma_or_attr« variable. Created attachment 42184 [details]
Proposed patch
Roland, does this patch look like it will fix your translation problems? If so I can submit it to gcc-patches.
I think there is an error here: @@ -9938,7 +9978,7 @@ aarch64_process_target_attr (tree args, const char* pragma_or_attr) if (len == 0) { - error ("malformed target %s value", pragma_or_attr); + error ("malformed target %s value", is_pragma); You should probably have two strings like you did in every other instance: if (is_pragma) error ("malformed target pragma value"); else error ("malformed target attribute value"); Everything else looks good to me (I'm the current French translator). Yes, the patch looks good to me. (I didn't even catch the one instance that Frederic found.) Thanks for putting this much effort into this issue. Author: sje Date: Thu Nov 2 21:56:00 2017 New Revision: 254359 URL: https://gcc.gnu.org/viewcvs?rev=254359&root=gcc&view=rev Log: PR target/79868 * config/aarch64/aarch64-c.c (aarch64_pragma_target_parse): Remove second argument from aarch64_process_target_attr call. * config/aarch64/aarch64-protos.h (aarch64_process_target_attr): Ditto. * config/aarch64/aarch64.c (aarch64_attribute_info): Change field type. (aarch64_handle_attr_arch): Remove second argument. (aarch64_handle_attr_cpu): Ditto. (aarch64_handle_attr_tune): Ditto. (aarch64_handle_attr_isa_flags): Ditto. (aarch64_process_one_target_attr): Ditto. (aarch64_process_target_attr): Ditto. (aarch64_option_valid_attribute_p): Remove second argument. on aarch64_process_target_attr call. Modified: trunk/gcc/ChangeLog trunk/gcc/config/aarch64/aarch64-c.c trunk/gcc/config/aarch64/aarch64-protos.h trunk/gcc/config/aarch64/aarch64.c Author: sje Date: Thu Nov 2 21:58:05 2017 New Revision: 254360 URL: https://gcc.gnu.org/viewcvs?rev=254360&root=gcc&view=rev Log: PR target/79868 * gcc.target/aarch64/spellcheck_1.c: Update dg-error string to match new format. * gcc.target/aarch64/spellcheck_2.c: Ditto. * gcc.target/aarch64/spellcheck_3.c: Ditto. * gcc.target/aarch64/target_attr_11.c: Ditto. * gcc.target/aarch64/target_attr_12.c: Ditto. * gcc.target/aarch64/target_attr_17.c: Ditto. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_1.c trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_2.c trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_3.c trunk/gcc/testsuite/gcc.target/aarch64/target_attr_11.c trunk/gcc/testsuite/gcc.target/aarch64/target_attr_12.c trunk/gcc/testsuite/gcc.target/aarch64/target_attr_17.c Fixed on Tot for 8.0. |