re PR objc/29200 (%s substituted with "methods"/"selectors" can't be properly translated)
gcc/ 2009-04-09 David Ayers <ayers@fsfe.org> PR objc/29200 * objc/objc-act.c (warn_with_method): Remove helper function. (check_duplicates): Call warning and inform directly. (really_start_method): Likewise. From-SVN: r145857
This commit is contained in:
parent
7a715bba70
commit
52daca759f
@ -1,3 +1,10 @@
|
||||
2009-04-09 David Ayers <ayers@fsfe.org>
|
||||
|
||||
PR objc/29200
|
||||
* objc/objc-act.c (warn_with_method): Remove helper function.
|
||||
(check_duplicates): Call warning and inform directly.
|
||||
(really_start_method): Likewise.
|
||||
|
||||
2009-04-09 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* expmed.c (expand_divmod): Always use a comparison for a division
|
||||
|
@ -243,7 +243,6 @@ static struct c_arg_info *objc_get_parm_info (int);
|
||||
|
||||
/* Utilities for debugging and error diagnostics. */
|
||||
|
||||
static void warn_with_method (const char *, int, tree);
|
||||
static char *gen_type_name (tree);
|
||||
static char *gen_type_name_0 (tree);
|
||||
static char *gen_method_decl (tree);
|
||||
@ -6103,22 +6102,37 @@ check_duplicates (hash hsh, int methods, int is_class)
|
||||
}
|
||||
|
||||
issue_warning:
|
||||
warning (0, "multiple %s named %<%c%s%> found",
|
||||
methods ? "methods" : "selectors",
|
||||
(is_class ? '+' : '-'),
|
||||
IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
|
||||
if (methods)
|
||||
{
|
||||
bool type = TREE_CODE (meth) == INSTANCE_METHOD_DECL;
|
||||
|
||||
warning (0, "multiple methods named %<%c%s%> found",
|
||||
(is_class ? '+' : '-'),
|
||||
IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
|
||||
inform (0, "%Jusing %<%c%s%>", meth,
|
||||
(type ? '-' : '+'),
|
||||
gen_method_decl (meth));
|
||||
}
|
||||
else
|
||||
{
|
||||
bool type = TREE_CODE (meth) == INSTANCE_METHOD_DECL;
|
||||
|
||||
warning (0, "multiple selectors named %<%c%s%> found",
|
||||
(is_class ? '+' : '-'),
|
||||
IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
|
||||
inform (0, "%Jfound %<%c%s%>", meth,
|
||||
(type ? '-' : '+'),
|
||||
gen_method_decl (meth));
|
||||
}
|
||||
|
||||
warn_with_method (methods ? "using" : "found",
|
||||
((TREE_CODE (meth) == INSTANCE_METHOD_DECL)
|
||||
? '-'
|
||||
: '+'),
|
||||
meth);
|
||||
for (loop = hsh->list; loop; loop = loop->next)
|
||||
warn_with_method ("also found",
|
||||
((TREE_CODE (loop->value) == INSTANCE_METHOD_DECL)
|
||||
? '-'
|
||||
: '+'),
|
||||
loop->value);
|
||||
{
|
||||
bool type = TREE_CODE (loop->value) == INSTANCE_METHOD_DECL;
|
||||
|
||||
inform (0, "%Jalso found %<%c%s%>", loop->value,
|
||||
(type ? '-' : '+'),
|
||||
gen_method_decl (loop->value));
|
||||
}
|
||||
}
|
||||
}
|
||||
return meth;
|
||||
@ -8427,14 +8441,6 @@ start_method_def (tree method)
|
||||
really_start_method (objc_method_context, parm_info);
|
||||
}
|
||||
|
||||
static void
|
||||
warn_with_method (const char *message, int mtype, tree method)
|
||||
{
|
||||
/* Add a readable method name to the warning. */
|
||||
warning (0, "%J%s %<%c%s%>", method,
|
||||
message, mtype, gen_method_decl (method));
|
||||
}
|
||||
|
||||
/* Return 1 if TYPE1 is equivalent to TYPE2
|
||||
for purposes of method overloading. */
|
||||
|
||||
@ -8677,10 +8683,14 @@ really_start_method (tree method,
|
||||
{
|
||||
if (!comp_proto_with_proto (method, proto, 1))
|
||||
{
|
||||
char type = (TREE_CODE (method) == INSTANCE_METHOD_DECL ? '-' : '+');
|
||||
bool type = TREE_CODE (method) == INSTANCE_METHOD_DECL;
|
||||
|
||||
warn_with_method ("conflicting types for", type, method);
|
||||
warn_with_method ("previous declaration of", type, proto);
|
||||
warning (0, "%Jconflicting types for %<%c%s%>", method,
|
||||
(type ? '-' : '+'),
|
||||
gen_method_decl (method));
|
||||
inform (0, "%Jprevious declaration of %<%c%s%>", proto,
|
||||
(type ? '-' : '+'),
|
||||
gen_method_decl (proto));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user