This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix up one mishandled plural in diagnostics in gimple-ssa-sprintf.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org, David Malcolm <dmalcolm at redhat dot com>
- Date: Tue, 19 Dec 2017 19:09:06 +0100
- Subject: Re: [PATCH] Fix up one mishandled plural in diagnostics in gimple-ssa-sprintf.c
- Authentication-results: sourceware.org; auth=none
- References: <20171219172049.GT2353@tucnak> <72df07f9-9634-4a05-d2dc-e8f0fdd40bd0@gmail.com> <20171219175815.GV2353@tucnak> <B3B4B2E4-0687-442D-ACFF-70D234F05C3B@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Dec 19, 2017 at 07:02:38PM +0100, Richard Biener wrote:
> On December 19, 2017 6:58:15 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
> >On Tue, Dec 19, 2017 at 10:49:07AM -0700, Martin Sebor wrote:
> >> Can the math be moved into inform_n (and warning_n) itself?
> >
> >No. I'm against having dozens of inform_n and warning_n etc.
> >overloads, it is already bad enough we have so many diagnostics
> >entry points now that putting breakpoints on them is so hard.
> >Those functions just have int, and we can have
> >perhaps some other function (plural_count or some better name)
> >that is inline and overloaded on the various types and can be used
> >if the count isn't int.
> >
> >As for gimple-ssa-sprintf.c, there are several other cases that
> >want a plural form, but I haven't changed them because
> >format_warning_at_substring doesn't have _n suffixed variant.
>
> Can't we simply use bytes (plural) and not care for the detail of special
> values like one? Other languages (Czech?) even have special cases for two
> and three...
If it is supposed to be gramattically correct, it should use the _n suffixed
APIs. There are languages with just 1 or 2, 3, 4 and 6 forms, see
https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html
for details.
Jakub