This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH]: tidy some code
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Nov 2002 12:23:34 -0500
- Subject: Re: [C PATCH]: tidy some code
>Paul Koning <pkoning@equallogic.com> writes:
>
>| > "Joseph S. Myers" <jsm28@cam.ac.uk> writes:
>| >
>| > | On 26 Nov 2002, Gabriel Dos Reis wrote:
>| > |
>| > | > Nathan Sidwell <nathan@codesourcery.com> writes:
>| > | >
>| > | > | if (code == UNION_TYPE)
>| > | > | ! error ("redefinition of `union %s'",
>IDENTIFIER_POINTER (name));
>| > | > | else
>| > | > | ! error ("redefinition of `struct %s'",
>IDENTIFIER_POINTER (name));
>| > | >
>| > | > Hi Nathan, I'm not clear about why this conditional is done
>here.
>| > | > I think the diagnostic machinary is able to figure out how to
>print
>| > | > name with the appropriate class-key. What else am I missing?
>| > |
>| > | That the code was made this way by Paolo Bonzini to allow for
>different
>| > | gender of struct/union/enum in some languages
>| > | <http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01330.html>
>(c-decl.c
>| > | revision 1.260).
>| >
>| > That, I think, is bogus:
>| >
>| > 1) here 'union' and 'struct' are not used as natural words; they
>are
>| > *keywords*
>|
>| True, but that doesn't change the point. Keywords are subject to the
>| rules of grammar of the natural language used for the message just as
>| much as any other component of the message.
>
>Not here because if you look at the diagnostic message carefully, it
>isn't saying
>
> structure '%s'
>
>nor
>
> struct '%s'
>
>but
>
> 'struct %s'
>
>that is keyword struct is part of the type-name. Translating 'struct'
>in this specific case is just not translating because it is not a
>noun: it is used to form a type-name.
>
>-- Gaby
What you may have missed is that some languages change the word for 'of'
based on the gender of the noun following. If 'of' cares about the gender
of its target, then
of 'struct %s'
may have a different 'of' than
of 'union %s'
does. After all, what's the gender of a quoted string? In some
languages, it's always considered neuter (which is fine), but in
others it's generally based on the gender of the interior words.
I prefer languages which don't inflect for gender; it's *much* more
convenient.
--Nathanael