[PATCH, c++ diagnostics] Fix c++ front end i18n problems

Shujing Zhao pearly.zhao@oracle.com
Tue Dec 1 09:40:00 GMT 2009


On 12/01/2009 04:39 PM, Paolo Bonzini wrote:
> On 12/01/2009 04:51 AM, Shujing Zhao wrote:
>> +  if (candidates->next)
>> +    str = "candidates are:";
>> +  else
>> +    str = "candidate is:";
>> +
>>     /* Remove deleted candidates.  */
> 
> Shouldn't the decision be taken _after_ removing deleted candidates?
> 
>> +/* The various readonly error string used by readonly_error.  */
>> +typedef enum readonly_error_str
>> +{
>> +  /* assignment */
>> +  RES_ASSIGNMENT,
>> +  /* assignment (via 'asm' output) */
>> +  RES_ASSIGNMENT_ASM,
>> +  /* increment */
>> +  RES_INCREMENT,
>> +  /* decrement */
>> +  RES_DECREMENT
>> +} readonly_error_str;
> 
> Leave this as an enum (no typedef).
> 
> 
>> +     issure an error-message and return.  */
> 
> "issue"
> 
>> +       if OVL_NEXT (fns)
> 
> Leave parentheses even though they are technically unnecessary. 
Ok, thanks.
  I
> disagree with extracting the choice between candidates are/candidate is 
> to a separate function; however, I'd just compute a bool here and pass 
> that to print_overloaded_functions.
> 
>> @@ -15747,12 +15756,17 @@ most_specialized_class (tree type, tree
> 
> You need to call gettext on str and wrap the strings (candidates 
> are/candidate is) with G_("...").  Also, there is a "candidates is:" 
> typo here.
> 
>> -      str = "               ";
>> +         str = "               ";
> 
> I'd just make str = "" here, since "candidate is" and "candidates are" 
> have different sizes.
When str is "candidate is", the loop will be only run one time. Though str is 
assigned again, it will never be used. Keep the "               " will make the 
output looking better.
> 
> I suggest you leave "candidate is" aside in the beginning and submit a 
> patch for the rest.  Then you can do a separate patch to fix the other 
> issue -- otherwise you'll make the same mistake as me and the patches 
> will lie uncommitted for seven more years. ;-)
Ok, thanks. I will sumbit a patch without "candidate is" first. And then handle 
the "candidates".

Pearly



More information about the Gcc-patches mailing list