From 07e3a3d29f34767991ff4decd0061e049b8faaa5 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Tue, 9 Nov 2004 10:20:12 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90338 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 19 ++++++++++--------- gcc/c-common.c | 22 +++++++++++----------- gcc/c-decl.c | 3 ++- gcc/c-format.c | 14 ++++++++------ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/builtin-prefetch-1.c | 12 ++++++------ 7 files changed, 46 insertions(+), 33 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2fbd2a29525..edbdb47f070 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-11-09 Joseph S. Myers + * builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument" + instead of "arg" in diagnostics. + +2004-11-09 Joseph S. Myers + * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, diff --git a/gcc/builtins.c b/gcc/builtins.c index 0d60c4dfa1b..5b476ca8fec 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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; } diff --git a/gcc/c-common.c b/gcc/c-common.c index 4a3944c0712..3a13dc78822 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -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; } diff --git a/gcc/c-decl.c b/gcc/c-decl.c index d30b24a06bd..f5bc6e5db6a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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; } diff --git a/gcc/c-format.c b/gcc/c-format.c index 8faeb173c2a..a0ae154ab4f 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c87ed688da6..d4e2788818a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2004-11-09 Joseph S. Myers + * gcc.dg/builtin-prefetch-1.c: Update expected diagnostic. + +2004-11-09 Joseph S. Myers + * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. 2004-11-08 Steve Ellcey diff --git a/gcc/testsuite/gcc.dg/builtin-prefetch-1.c b/gcc/testsuite/gcc.dg/builtin-prefetch-1.c index f3429eed260..11beb4e1bbe 100644 --- a/gcc/testsuite/gcc.dg/builtin-prefetch-1.c +++ b/gcc/testsuite/gcc.dg/builtin-prefetch-1.c @@ -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 -- 2.11.4.GIT