From 91d6fa6a035cc7d0b7be5c99c194a64cb80924b0 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 Dec 2009 13:42:17 +0000 Subject: Add -Wshadow to the gcc command line options used when compiling the binutils. Fix up all warnings generated by the addition of this switch. --- gas/config/tc-tic54x.c | 83 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) (limited to 'gas/config/tc-tic54x.c') diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index eb1815c..1a00bb4 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -243,11 +243,11 @@ md_show_usage (FILE *stream) static void tic54x_emit_char (char c) { - expressionS exp; + expressionS expn; - exp.X_op = O_constant; - exp.X_add_number = c; - emit_expr (&exp, 2); + expn.X_op = O_constant; + expn.X_add_number = c; + emit_expr (&expn, 2); } /* Walk backwards in the frag chain. */ @@ -298,14 +298,14 @@ frag_bit_offset (fragS *frag, segT seg) expression. */ static char * -parse_expression (char *str, expressionS *exp) +parse_expression (char *str, expressionS *expn) { char *s; char *tmp; tmp = input_line_pointer; /* Save line pointer. */ input_line_pointer = str; - expression (exp); + expression (expn); s = input_line_pointer; input_line_pointer = tmp; /* Restore line pointer. */ return s; /* Return pointer to where parsing stopped. */ @@ -1018,12 +1018,12 @@ tic54x_cons (int type) } else { - expressionS exp; + expressionS expn; - input_line_pointer = parse_expression (input_line_pointer, &exp); - if (exp.X_op == O_constant) + input_line_pointer = parse_expression (input_line_pointer, &expn); + if (expn.X_op == O_constant) { - offsetT value = exp.X_add_number; + offsetT value = expn.X_add_number; /* Truncate overflows. */ switch (octets) { @@ -1039,7 +1039,7 @@ tic54x_cons (int type) break; } } - if (exp.X_op != O_constant && octets < 2) + if (expn.X_op != O_constant && octets < 2) { /* Disallow .byte with a non constant expression that will require relocation. */ @@ -1048,7 +1048,7 @@ tic54x_cons (int type) return; } - if (exp.X_op != O_constant + if (expn.X_op != O_constant && amode == c_mode && octets == 4) { @@ -1059,14 +1059,14 @@ tic54x_cons (int type) totally ignored in the latest tools). */ amode = far_mode; emitting_long = 1; - emit_expr (&exp, 4); + emit_expr (&expn, 4); emitting_long = 0; amode = c_mode; } else { emitting_long = octets == 4; - emit_expr (&exp, (octets == 1) ? 2 : octets); + emit_expr (&expn, (octets == 1) ? 2 : octets); emitting_long = 0; } } @@ -1222,7 +1222,7 @@ tic54x_sect (int arg) static void tic54x_space (int arg) { - expressionS exp; + expressionS expn; char *p = 0; int octets = 0; long words; @@ -1238,22 +1238,21 @@ tic54x_space (int arg) #endif /* Read the bit count. */ - expression (&exp); + expression (&expn); /* Some expressions are unresolvable until later in the assembly pass; postpone until relaxation/fixup. we also have to postpone if a previous partial allocation has not been completed yet. */ - if (exp.X_op != O_constant || frag_bit_offset (frag_now, now_seg) == -1) + if (expn.X_op != O_constant || frag_bit_offset (frag_now, now_seg) == -1) { struct bit_info *bi = xmalloc (sizeof (struct bit_info)); - char *p; bi->seg = now_seg; bi->type = bes; bi->sym = label; p = frag_var (rs_machine_dependent, 65536 * 2, 1, (relax_substateT) 0, - make_expr_symbol (&exp), (offsetT) 0, + make_expr_symbol (&expn), (offsetT) 0, (char *) bi); if (p) *p = 0; @@ -1268,7 +1267,7 @@ tic54x_space (int arg) { int spare_bits = bits_per_byte - bit_offset; - if (spare_bits >= exp.X_add_number) + if (spare_bits >= expn.X_add_number) { /* Don't have to do anything; sufficient bits have already been allocated; just point the label to the right place. */ @@ -1278,10 +1277,10 @@ tic54x_space (int arg) S_SET_VALUE (label, frag_now_fix () - 1); label = NULL; } - frag_now->tc_frag_data += exp.X_add_number; + frag_now->tc_frag_data += expn.X_add_number; goto getout; } - exp.X_add_number -= spare_bits; + expn.X_add_number -= spare_bits; /* Set the label to point to the first word allocated, which in this case is the previous word, which was only partially filled. */ if (!bes && label != NULL) @@ -1292,9 +1291,9 @@ tic54x_space (int arg) } } /* Convert bits to bytes/words and octets, rounding up. */ - words = ((exp.X_add_number + bits_per_byte - 1) / bits_per_byte); + words = ((expn.X_add_number + bits_per_byte - 1) / bits_per_byte); /* How many do we have left over? */ - bit_offset = exp.X_add_number % bits_per_byte; + bit_offset = expn.X_add_number % bits_per_byte; octets = words * OCTETS_PER_BYTE; if (octets < 0) { @@ -1695,7 +1694,7 @@ tic54x_align_words (int arg) static void tic54x_field (int ignore ATTRIBUTE_UNUSED) { - expressionS exp; + expressionS expn; int size = 16; char *p; valueT value; @@ -1707,7 +1706,7 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) return; } - input_line_pointer = parse_expression (input_line_pointer, &exp); + input_line_pointer = parse_expression (input_line_pointer, &expn); if (*input_line_pointer == ',') { @@ -1722,7 +1721,7 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) } /* Truncate values to the field width. */ - if (exp.X_op != O_constant) + if (expn.X_op != O_constant) { /* If the expression value is relocatable, the field size *must* be 16. */ @@ -1734,17 +1733,17 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) } frag_now->tc_frag_data = 0; - emit_expr (&exp, 2); + emit_expr (&expn, 2); } else { unsigned long fmask = (size == 32) ? 0xFFFFFFFF : (1ul << size) - 1; - value = exp.X_add_number; - exp.X_add_number &= fmask; - if (value != (valueT) exp.X_add_number) + value = expn.X_add_number; + expn.X_add_number &= fmask; + if (value != (valueT) expn.X_add_number) as_warn (_("field value truncated")); - value = exp.X_add_number; + value = expn.X_add_number; /* Bits are stored MS first. */ while (size >= 16) { @@ -2656,11 +2655,11 @@ subsym_ismember (char *sym, char *list) static int subsym_iscons (char *a, char *ignore ATTRIBUTE_UNUSED) { - expressionS exp; + expressionS expn; - parse_expression (a, &exp); + parse_expression (a, &expn); - if (exp.X_op == O_constant) + if (expn.X_op == O_constant) { int len = strlen (a); @@ -4570,10 +4569,10 @@ subsym_substitute (char *line, int forced) ++ptr; if (math_entry != NULL) { - float arg1, arg2 = 0; + float farg1, farg2 = 0; volatile float fresult; - arg1 = (float) strtod (ptr, &ptr); + farg1 = (float) strtod (ptr, &ptr); if (math_entry->nargs == 2) { if (*ptr++ != ',') @@ -4581,9 +4580,9 @@ subsym_substitute (char *line, int forced) as_bad (_("Expecting second argument")); break; } - arg2 = (float) strtod (ptr, &ptr); + farg2 = (float) strtod (ptr, &ptr); } - fresult = (*math_entry->proc) (arg1, arg2); + fresult = (*math_entry->proc) (farg1, farg2); value = xmalloc (128); if (math_entry->int_return) sprintf (value, "%d", (int) fresult); @@ -5080,7 +5079,7 @@ tic54x_undefined_symbol (char *name) int tic54x_parse_name (char *name ATTRIBUTE_UNUSED, - expressionS *exp ATTRIBUTE_UNUSED) + expressionS *expn ATTRIBUTE_UNUSED) { return 0; } @@ -5125,7 +5124,7 @@ tc_gen_reloc (asection *section, fixS *fixP) /* Handle cons expressions. */ void -tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) +tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *expn) { bfd_reloc_code_real_type r; @@ -5148,7 +5147,7 @@ tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) r = BFD_RELOC_32; break; } - fix_new_exp (frag, where, octets, exp, 0, r); + fix_new_exp (frag, where, octets, expn, 0, r); } /* Attempt to simplify or even eliminate a fixup. -- cgit v1.1