This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failed to build bfin-elf-as because of shadowed declaration.


On 01/14/2010 09:59 AM, Masaki Muranaka wrote:
Hello,

I've some warnings when building tc-btin.c (the version of i386-pc-mingw32-gcc is 3.4.5).
This can be fixed routinely. I hesitate to create patch though since there are a lot of declarations in bfin-aux.h.
It's possible to fix the place we get warnings. But it brakes some kind of consistency.
Do we need variable names in global declaration there?

I don't think so. It seems gcc-3.4 is stricter than gcc-4.x on shadow warning. gcc-4.x does not report these warnings. I'm committing the attached patch. Tested using gcc-3.4 on Debian. Regtest is OK for bfin-elf target.

Thanks,
Jie
	* config/bfin-aux.h: Remove argument names in function
	declarations.
	* config/bfin-lex.l (parse_int): Fix shadowed variable name
	warning.
	* config/bfin-parse.y (value_match): Remove argument names
	in declaration.
	(notethat): Likewise.
	(yyerror): Likewise.

Index: config/bfin-aux.h
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-aux.h,v
retrieving revision 1.5
diff -u -p -r1.5 bfin-aux.h
--- config/bfin-aux.h	3 Sep 2009 15:36:01 -0000	1.5
+++ config/bfin-aux.h	14 Jan 2010 04:37:41 -0000
@@ -1,5 +1,5 @@
 /* bfin-aux.h ADI Blackfin Header file for gas
-   Copyright 2005, 2007, 2009
+   Copyright 2005, 2007, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -23,132 +23,45 @@
 
 #define REG_T Register *
 
-INSTR_T
-bfin_gen_dsp32mac (int op1, int mm, int mmod, int w1, int p,
-              int h01, int h11, int h00, int h10,
-	      int op0, REG_T dst, REG_T src0, REG_T src1, int w0);
-
-INSTR_T
-bfin_gen_dsp32mult (int op1, int mm, int mmod, int w1, int p,
-               int h01, int h11, int h00, int h10,
-	       int op0, REG_T dst, REG_T src0, REG_T src1, int w0);
-
-INSTR_T
-bfin_gen_dsp32alu (int HL, int aopcde, int aop, int s, int x,
-              REG_T dst0, REG_T dst1, REG_T src0, REG_T src1);
-
-INSTR_T
-bfin_gen_dsp32shift (int sopcde, REG_T dst0, REG_T src0, REG_T src1,
-                int sop, int hls);
-
-INSTR_T
-bfin_gen_dsp32shiftimm (int sopcde, REG_T dst0, int immag, REG_T src1,
-                   int sop, int hls);
-
-INSTR_T
-bfin_gen_ldimmhalf (REG_T reg, int h, int s, int z, Expr_Node *hword,
-               int reloc);
-
-INSTR_T
-bfin_gen_ldstidxi (REG_T ptr, REG_T reg, int w, int sz, int z,
-              Expr_Node *offset);
-
-INSTR_T
-bfin_gen_ldst (REG_T ptr, REG_T reg, int aop, int sz, int z, int w);
-
-INSTR_T
-bfin_gen_ldstii (REG_T ptr, REG_T reg, Expr_Node *offset, int w, int op);
-
-INSTR_T
-bfin_gen_ldstiifp (REG_T reg, Expr_Node *offset, int w);
-
-INSTR_T
-bfin_gen_ldstpmod (REG_T ptr, REG_T reg, int aop, int w, REG_T idx);
-
-INSTR_T
-bfin_gen_dspldst (REG_T i, REG_T reg, int aop, int w, int m);
-
-INSTR_T
-bfin_gen_alu2op (REG_T dst, REG_T src, int opc);
-
-INSTR_T
-bfin_gen_compi2opd (REG_T dst, int src, int op);
-
-INSTR_T
-bfin_gen_compi2opp (REG_T dst, int src, int op);
-
-INSTR_T
-bfin_gen_dagmodik (REG_T i, int op);
-
-INSTR_T
-bfin_gen_dagmodim (REG_T i, REG_T m, int op, int br);
-
-INSTR_T
-bfin_gen_ptr2op (REG_T dst, REG_T src, int opc);
-
-INSTR_T
-bfin_gen_logi2op (int dst, int src, int opc);
-
-INSTR_T
-bfin_gen_comp3op (REG_T src0, REG_T src1, REG_T dst, int opc);
-
-INSTR_T
-bfin_gen_ccmv (REG_T src, REG_T dst, int t);
-
-INSTR_T
-bfin_gen_ccflag (REG_T x, int y, int opc, int i, int g);
-
-INSTR_T
-bfin_gen_cc2stat (int cbit, int op, int d);
-
-INSTR_T
-bfin_gen_regmv (REG_T src, REG_T dst);
-
-INSTR_T
-bfin_gen_cc2dreg (int op, REG_T reg);
-
-INSTR_T
-bfin_gen_brcc (int t, int b, Expr_Node *offset);
-
-INSTR_T
-bfin_gen_ujump (Expr_Node *offset);
-
-INSTR_T
-bfin_gen_cactrl (REG_T reg, int a, int op);
-
-INSTR_T
-bfin_gen_progctrl (int prgfunc, int poprnd);
-
-INSTR_T
-bfin_gen_loopsetup (Expr_Node *soffset, REG_T c, int rop,
-               Expr_Node *eoffset, REG_T reg);
-
-INSTR_T
-bfin_gen_loop (Expr_Node *expr, REG_T reg, int rop, REG_T preg);
-
-void
-bfin_loop_beginend (Expr_Node *expr, int begin);
-
-INSTR_T
-bfin_gen_pushpopmultiple (int dr, int pr, int d, int p, int w);
-
-INSTR_T
-bfin_gen_pushpopreg (REG_T reg, int w);
-
-INSTR_T
-bfin_gen_calla (Expr_Node *addr, int s);
-
-INSTR_T
-bfin_gen_linkage (int r, int framesize);
-
-INSTR_T
-bfin_gen_pseudodbg (int fn, int reg, int grp);
-
-INSTR_T
-bfin_gen_pseudodbg_assert (int dbgop, REG_T regtest, int expected);
-
-bfd_boolean
-bfin_resource_conflict (INSTR_T dsp32, INSTR_T dsp16_grp1, INSTR_T dsp16_grp2);
-
-INSTR_T
-bfin_gen_multi_instr (INSTR_T dsp32, INSTR_T dsp16_grp1, INSTR_T dsp16_grp2);
+INSTR_T bfin_gen_dsp32mac (int, int, int, int, int, int, int, int, int, int,
+			   REG_T, REG_T, REG_T, int);
+INSTR_T bfin_gen_dsp32mult (int, int, int, int, int, int, int, int, int, int,
+			    REG_T, REG_T, REG_T, int);
+INSTR_T bfin_gen_dsp32alu (int, int, int, int, int, REG_T, REG_T, REG_T, REG_T);
+INSTR_T bfin_gen_dsp32shift (int, REG_T, REG_T, REG_T, int, int);
+INSTR_T bfin_gen_dsp32shiftimm (int, REG_T, int, REG_T, int, int);
+INSTR_T bfin_gen_ldimmhalf (REG_T, int, int, int, Expr_Node *, int);
+INSTR_T bfin_gen_ldstidxi (REG_T, REG_T, int, int, int, Expr_Node *);
+INSTR_T bfin_gen_ldst (REG_T, REG_T, int, int, int, int);
+INSTR_T bfin_gen_ldstii (REG_T, REG_T, Expr_Node *, int, int);
+INSTR_T bfin_gen_ldstiifp (REG_T, Expr_Node *, int);
+INSTR_T bfin_gen_ldstpmod (REG_T, REG_T, int, int, REG_T);
+INSTR_T bfin_gen_dspldst (REG_T, REG_T, int, int, int);
+INSTR_T bfin_gen_alu2op (REG_T, REG_T, int);
+INSTR_T bfin_gen_compi2opd (REG_T, int, int);
+INSTR_T bfin_gen_compi2opp (REG_T, int, int);
+INSTR_T bfin_gen_dagmodik (REG_T, int);
+INSTR_T bfin_gen_dagmodim (REG_T, REG_T, int, int);
+INSTR_T bfin_gen_ptr2op (REG_T, REG_T, int);
+INSTR_T bfin_gen_logi2op (int, int, int);
+INSTR_T bfin_gen_comp3op (REG_T, REG_T, REG_T, int);
+INSTR_T bfin_gen_ccmv (REG_T, REG_T, int);
+INSTR_T bfin_gen_ccflag (REG_T, int, int, int, int);
+INSTR_T bfin_gen_cc2stat (int, int, int);
+INSTR_T bfin_gen_regmv (REG_T, REG_T);
+INSTR_T bfin_gen_cc2dreg (int, REG_T);
+INSTR_T bfin_gen_brcc (int, int, Expr_Node *);
+INSTR_T bfin_gen_ujump (Expr_Node *);
+INSTR_T bfin_gen_cactrl (REG_T, int, int);
+INSTR_T bfin_gen_progctrl (int, int);
+INSTR_T bfin_gen_loopsetup (Expr_Node *, REG_T, int, Expr_Node *, REG_T);
+INSTR_T bfin_gen_loop (Expr_Node *, REG_T, int, REG_T);
+void bfin_loop_beginend (Expr_Node *, int);
+INSTR_T bfin_gen_pushpopmultiple (int, int, int, int, int);
+INSTR_T bfin_gen_pushpopreg (REG_T, int);
+INSTR_T bfin_gen_calla (Expr_Node *, int);
+INSTR_T bfin_gen_linkage (int, int);
+INSTR_T bfin_gen_pseudodbg (int, int, int);
+INSTR_T bfin_gen_pseudodbg_assert (int, REG_T, int);
+bfd_boolean bfin_resource_conflict (INSTR_T, INSTR_T, INSTR_T);
+INSTR_T bfin_gen_multi_instr (INSTR_T, INSTR_T, INSTR_T);
Index: config/bfin-lex.l
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-lex.l,v
retrieving revision 1.9
diff -u -p -r1.9 bfin-lex.l
--- config/bfin-lex.l	3 Sep 2009 17:52:06 -0000	1.9
+++ config/bfin-lex.l	14 Jan 2010 04:37:42 -0000
@@ -1,5 +1,5 @@
 /* bfin-lex.l  ADI Blackfin lexer
-   Copyright 2005, 2006, 2007, 2008
+   Copyright 2005, 2006, 2007, 2008, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -341,7 +341,6 @@ static long parse_int (char **end)
   int shiftvalue = 0;
   char * char_bag;
   long value = 0;
-  char c;
   char *arg = *end;
 
   while (*arg && *arg == ' ')
@@ -363,7 +362,7 @@ static long parse_int (char **end)
 
       case '0':  /* Accept different formated integers hex octal and binary. */
         {
-	  c = *++arg;
+	  char c = *++arg;
           arg++;
 	  if (c == 'x' || c == 'X') /* Hex input.  */
 	    fmt = 'h';
@@ -460,7 +459,7 @@ static long parse_int (char **end)
         {
           while (1)
             {
-              int c;
+              char c;
               c = *arg++;
               if (c >= '0' && c <= '9')
                 value = (value * 10) + (c - '0');
Index: config/bfin-parse.y
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-parse.y,v
retrieving revision 1.35
diff -u -p -r1.35 bfin-parse.y
--- config/bfin-parse.y	11 Dec 2009 13:42:10 -0000	1.35
+++ config/bfin-parse.y	14 Jan 2010 04:37:42 -0000
@@ -1,5 +1,5 @@
 /* bfin-parse.y  ADI Blackfin parser
-   Copyright 2005, 2006, 2007, 2008, 2009
+   Copyright 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -152,7 +152,7 @@
 	(value_match (expr, 24, 0, 2, 1))
 
 
-static int value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned);
+static int value_match (Expr_Node *, int, int, int, int);
 
 extern FILE *errorf;
 extern INSTR_T insn;
@@ -160,11 +160,11 @@ extern INSTR_T insn;
 static Expr_Node *binary (Expr_Op_Type, Expr_Node *, Expr_Node *);
 static Expr_Node *unary  (Expr_Op_Type, Expr_Node *);
 
-static void notethat (char *format, ...);
+static void notethat (char *, ...);
 
 char *current_inputline;
 extern char *yytext;
-int yyerror (char *msg);
+int yyerror (char *);
 
 void error (char *format, ...)
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]