builtins.c, [...]: Say "argument" instead of "arg" in diagnostics.

* builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument"
	instead of "arg" in diagnostics.

testsuite:
	* gcc.dg/builtin-prefetch-1.c: Update expected diagnostic.

From-SVN: r90338
This commit is contained in:
Joseph Myers 2004-11-09 10:20:12 +00:00 committed by Joseph Myers
parent 9e637a2679
commit 40b97a2e29
7 changed files with 46 additions and 33 deletions

View File

@ -1,3 +1,8 @@
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument"
instead of "arg" in diagnostics.
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,

View File

@ -922,28 +922,29 @@ expand_builtin_prefetch (tree arglist)
/* Argument 1 (read/write flag) must be a compile-time constant int. */
if (TREE_CODE (arg1) != INTEGER_CST)
{
error ("second arg to %<__builtin_prefetch%> must be a constant");
error ("second argument to %<__builtin_prefetch%> must be a constant");
arg1 = integer_zero_node;
}
op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
/* Argument 1 must be either zero or one. */
if (INTVAL (op1) != 0 && INTVAL (op1) != 1)
{
warning ("invalid second arg to %<__builtin_prefetch%>; using zero");
warning ("invalid second argument to %<__builtin_prefetch%>;"
" using zero");
op1 = const0_rtx;
}
/* Argument 2 (locality) must be a compile-time constant int. */
if (TREE_CODE (arg2) != INTEGER_CST)
{
error ("third arg to %<__builtin_prefetch%> must be a constant");
error ("third argument to %<__builtin_prefetch%> must be a constant");
arg2 = integer_zero_node;
}
op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
/* Argument 2 must be 0, 1, 2, or 3. */
if (INTVAL (op2) < 0 || INTVAL (op2) > 3)
{
warning ("invalid third arg to %<__builtin_prefetch%>; using zero");
warning ("invalid third argument to %<__builtin_prefetch%>; using zero");
op2 = const0_rtx;
}
@ -4158,9 +4159,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
else if (! host_integerp (TREE_VALUE (arglist), 1))
{
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
error ("invalid arg to %<__builtin_frame_address%>");
error ("invalid argument to %<__builtin_frame_address%>");
else
error ("invalid arg to %<__builtin_return_address%>");
error ("invalid argument to %<__builtin_return_address%>");
return const0_rtx;
}
else
@ -4174,9 +4175,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
if (tem == NULL)
{
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
warning ("unsupported arg to %<__builtin_frame_address%>");
warning ("unsupported argument to %<__builtin_frame_address%>");
else
warning ("unsupported arg to %<__builtin_return_address%>");
warning ("unsupported argument to %<__builtin_return_address%>");
return const0_rtx;
}
@ -4279,7 +4280,7 @@ expand_builtin_expect (tree arglist, rtx target)
if (TREE_CODE (c) != INTEGER_CST)
{
error ("second arg to %<__builtin_expect%> must be a constant");
error ("second argument to %<__builtin_expect%> must be a constant");
c = integer_zero_node;
}

View File

@ -4577,7 +4577,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
id = TREE_VALUE (args);
if (TREE_CODE (id) != STRING_CST)
{
error ("alias arg not a string");
error ("alias argument not a string");
*no_add_attrs = true;
return NULL_TREE;
}
@ -4632,7 +4632,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
if (TREE_CODE (id) != STRING_CST)
{
error ("visibility arg not a string");
error ("visibility argument not a string");
return NULL_TREE;
}
@ -4653,7 +4653,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0)
DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED;
else
error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
error ("visibility argument must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
DECL_VISIBILITY_SPECIFIED (decl) = 1;
/* For decls only, go ahead and attach the attribute to the node as well.
@ -4722,7 +4722,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
id = TREE_VALUE (args);
if (TREE_CODE (id) != STRING_CST)
{
error ("tls_model arg not a string");
error ("tls_model argument not a string");
*no_add_attrs = true;
return NULL_TREE;
}
@ -4731,7 +4731,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
&& strcmp (TREE_STRING_POINTER (id), "local-dynamic")
&& strcmp (TREE_STRING_POINTER (id), "global-dynamic"))
{
error ("tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"");
error ("tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"");
*no_add_attrs = true;
return NULL_TREE;
}
@ -4993,7 +4993,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (!get_nonnull_operand (TREE_VALUE (args), &arg_num))
{
error ("nonnull argument has invalid operand number (arg %lu)",
error ("nonnull argument has invalid operand number (argument %lu)",
(unsigned long) attr_arg_num);
*no_add_attrs = true;
return NULL_TREE;
@ -5012,7 +5012,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (!argument
|| TREE_CODE (TREE_VALUE (argument)) == VOID_TYPE)
{
error ("nonnull argument with out-of-range operand number (arg %lu, operand %lu)",
error ("nonnull argument with out-of-range operand number (argument %lu, operand %lu)",
(unsigned long) attr_arg_num, (unsigned long) arg_num);
*no_add_attrs = true;
return NULL_TREE;
@ -5020,7 +5020,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE)
{
error ("nonnull argument references non-pointer operand (arg %lu, operand %lu)",
error ("nonnull argument references non-pointer operand (argument %lu, operand %lu)",
(unsigned long) attr_arg_num, (unsigned long) arg_num);
*no_add_attrs = true;
return NULL_TREE;
@ -5154,7 +5154,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param,
return;
if (integer_zerop (param))
warning ("null argument where non-null required (arg %lu)",
warning ("null argument where non-null required (argument %lu)",
(unsigned long) param_num);
}
@ -5225,14 +5225,14 @@ handle_cleanup_attribute (tree *node, tree name, tree args,
cleanup_id = TREE_VALUE (args);
if (TREE_CODE (cleanup_id) != IDENTIFIER_NODE)
{
error ("cleanup arg not an identifier");
error ("cleanup argument not an identifier");
*no_add_attrs = true;
return NULL_TREE;
}
cleanup_decl = lookup_name (cleanup_id);
if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL)
{
error ("cleanup arg not a function");
error ("cleanup argument not a function");
*no_add_attrs = true;
return NULL_TREE;
}

View File

@ -1063,7 +1063,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
for the arg. */
else if (!comptypes (oldargtype, newargtype))
{
error ("%Jprototype for %qD declares arg %d with incompatible type",
error ("%Jprototype for %qD declares argument %d"
" with incompatible type",
newdecl, newdecl, i);
return false;
}

View File

@ -139,7 +139,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
!= char_type_node))
{
if (!(flags & (int) ATTR_FLAG_BUILT_IN))
error ("format string arg not a string type");
error ("format string argument not a string type");
*no_add_attrs = true;
return false;
}
@ -219,7 +219,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num)
{
gcc_assert (!validated_p);
error ("format string arg follows the args to be formatted");
error ("format string argument follows the args to be formatted");
return false;
}
@ -2069,7 +2069,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0
&& cur_param != 0
&& integer_zerop (cur_param))
warning ("writing through null pointer (arg %d)",
warning ("writing through null pointer (argument %d)",
arg_num);
/* Check for reading through a NULL pointer. */
@ -2077,7 +2077,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0
&& cur_param != 0
&& integer_zerop (cur_param))
warning ("reading through null pointer (arg %d)",
warning ("reading through null pointer (argument %d)",
arg_num);
if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR)
@ -2097,7 +2097,8 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (CONSTANT_CLASS_P (cur_param)
|| (DECL_P (cur_param)
&& TREE_READONLY (cur_param))))))
warning ("writing into constant object (arg %d)", arg_num);
warning ("writing into constant object (argument %d)",
arg_num);
/* If there are extra type qualifiers beyond the first
indirection, then this makes the types technically
@ -2107,7 +2108,8 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (TYPE_READONLY (cur_type)
|| TYPE_VOLATILE (cur_type)
|| TYPE_RESTRICT (cur_type)))
warning ("extra type qualifiers in format argument (arg %d)",
warning ("extra type qualifiers in format argument "
"(argument %d)",
arg_num);
}

View File

@ -1,3 +1,7 @@
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/builtin-prefetch-1.c: Update expected diagnostic.
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/builtin-prefetch-1.c: Adjust expected messages.

View File

@ -28,12 +28,12 @@ good (int *p)
void
bad (int *p)
{
__builtin_prefetch (p, -1, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 2, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, bogus, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, -1); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, 4); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, bogus); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, -1, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 2, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, bogus, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, -1); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, 4); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, bogus); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
}
int