From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68698 invoked by alias); 15 Mar 2017 10:59:59 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 68669 invoked by uid 89); 15 Mar 2017 10:59:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=dent, no_backtrace, 12K, 20someodd X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Mar 2017 10:59:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2442E2B; Wed, 15 Mar 2017 03:59:55 -0700 (PDT) Received: from e105689-lin.cambridge.arm.com (e105689-lin.cambridge.arm.com [10.2.207.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ED553F220; Wed, 15 Mar 2017 03:59:54 -0700 (PDT) Subject: Re: Diagnostics that should not be translated To: Martin Sebor , Roland Illig , gcc@gcc.gnu.org References: <85c5fd8b-1a22-4040-ee42-52bd29837d3e@gmx.de> <52a50d44-aaaf-0543-b313-e5d0d5652a64@gmail.com> From: "Richard Earnshaw (lists)" Message-ID: Date: Wed, 15 Mar 2017 10:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <52a50d44-aaaf-0543-b313-e5d0d5652a64@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00079.txt.bz2 On 15/03/17 02:43, Martin Sebor wrote: > On 03/12/2017 04:51 PM, Roland Illig wrote: >> Hi, >> >> the gcc.pot file currently contains more than 12000 messages to be >> translated, which is a very high number. Many of these messages are >> diagnostics, and they can be categorized as follows: >> >> * errors in user programs, reported via error () >> * additional info for internal errors, reported via error () >> * internal errors, reported via gfc_internal_error () >> * others >> >> In my opinion, there is no point in having internal error messages >> translated, since their only purpose is to be sent back to the GCC >> developers, instead of being interpreted and acted upon by the GCC user. >> By not translating the internal errors, the necessary work for >> translators can be cut down by several hundred messages. >> >> Therefore the internal errors should not be translated at all. >> https://gcc.gnu.org/codingconventions.html#Diagnostics currently >> mentions a few ways of emitting diagnostics, but there is no way to >> produce untranslated diagnostics. Therefore I'd like to have a new >> function error_no_i18n that is used instead of error for nonfatal >> internal errors, like this: >> >> @code{error_no_i18n} is for diagnostics that are printed before invoking >> internal_error. They are not translated. > > AFAIK, internal errors are reported using the internal_error > or internal_error_no_backtrace APIs. > > Would using the existing internal_error{,no_backtrace}, and > sorry work for this? (I.e., not translating those.) If my > count is right there are nearly 500 calls to these three in > GCC sources so I'm not sure that would put enough of a dent > in the 12K messages to translate but I'm even less sure that > adding yet another API would do even that much. > I think sorry messages need to be translated: the user has hit a limitation in the compiler that they need to be aware of (such as unsupported option combination). R. > There are 20-some-odd functions to report diagnostics in GCC > (counting those in diagnostic-core.h). I haven't used them all > or even understand all their differences and use cases yet so > I would rather no add more to the list if it can be helped. > > Martin >