This is the mail archive of the binutils@sources.redhat.com 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]

[PATCH]: gas, opcodes Warnings


Hi,

The attached patch gets rid of some warnings when building
gas and opcodes. Most of them are unused parameters and integer
signedness. The only thing I'm not sure about is whether it's
permissable to use ATTRIBUTE_UNSIGNED in this code.

Seeking approval to commit this.

Dave
2000-07-13  Dave Brolley  <brolley@redhat.com>

	* cgen.c (queue_fixup): Declare opinfo.
	(gas_cgen_parse_operand): Mark unused parameters with ATTRIBUTE_UNUSED.
	(gas_cgen_md_operand): Ditto.
	(gas_cgen_md_apply_fix3): Ditto.

2000-07-13  Dave Brolley  <brolley@redhat.com>

	* cgen.h (cgen_hw_lookup_by_num): Second parameter is unsigned.

2000-07-13  Dave Brolley  <brolley@redhat.com>

	* cgen-opc.c (cgen_hw_lookup_by_name): 'i' is now unsigned.
	(cgen_hw_lookup_by_num): Ditto.
	(cgen_operand_lookup_by_name): Ditto.
	* cgen-dis.c (hash_insn_array): Mark unused parameters with
	ATTRIBUTE_UNUSED.
	* cgen-asm.c (hash_insn_array): Mark unused parameters with
	ATTRIBUTE_UNUSED.
	(cgen_parse_keyword): Ditto.

Index: gas/cgen.c
===================================================================
RCS file: /cvs/src/src/gas/cgen.c,v
retrieving revision 1.3
diff -c -p -r1.3 cgen.c
*** cgen.c	2000/06/24 15:10:45	1.3
--- cgen.c	2000/07/13 21:21:02
*************** gas_cgen_init_parse ()
*** 81,86 ****
--- 81,87 ----
  static void
  queue_fixup (opindex, opinfo, expP)
       int           opindex;
+      int           opinfo;
       expressionS * expP;
  {
    /* We need to generate a fixup for this expression.  */
*************** static int expr_jmp_buf_p;
*** 247,253 ****
  
  const char *
  gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
!      CGEN_CPU_DESC cd;
       enum cgen_parse_operand_type want;
       const char ** strP;
       int opindex;
--- 248,254 ----
  
  const char *
  gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
       enum cgen_parse_operand_type want;
       const char ** strP;
       int opindex;
*************** gas_cgen_parse_operand (cd, want, strP, 
*** 330,336 ****
  
  void
  gas_cgen_md_operand (expressionP)
!      expressionS * expressionP;
  {
    /* Don't longjmp if we're not called from within cgen_parse_operand().  */
    if (expr_jmp_buf_p)
--- 331,337 ----
  
  void
  gas_cgen_md_operand (expressionP)
!      expressionS * expressionP ATTRIBUTE_UNUSED;
  {
    /* Don't longjmp if we're not called from within cgen_parse_operand().  */
    if (expr_jmp_buf_p)
*************** int
*** 494,500 ****
  gas_cgen_md_apply_fix3 (fixP, valueP, seg)
       fixS *   fixP;
       valueT * valueP;
!      segT     seg;
  {
    char * where = fixP->fx_frag->fr_literal + fixP->fx_where;
    valueT value;
--- 495,501 ----
  gas_cgen_md_apply_fix3 (fixP, valueP, seg)
       fixS *   fixP;
       valueT * valueP;
!      segT     seg ATTRIBUTE_UNUSED;
  {
    char * where = fixP->fx_frag->fr_literal + fixP->fx_where;
    valueT value;
*************** gas_cgen_md_apply_fix3 (fixP, valueP, se
*** 637,643 ****
  
  arelent *
  gas_cgen_tc_gen_reloc (section, fixP)
!      asection * section;
       fixS *     fixP;
  {
    arelent * reloc;
--- 638,644 ----
  
  arelent *
  gas_cgen_tc_gen_reloc (section, fixP)
!      asection * section ATTRIBUTE_UNUSED;
       fixS *     fixP;
  {
    arelent * reloc;
Index: include/opcode/cgen.h
===================================================================
RCS file: /cvs/src/src/include/opcode/cgen.h,v
retrieving revision 1.6
diff -c -p -r1.6 cgen.h
*** cgen.h	2000/06/19 01:22:42	1.6
--- cgen.h	2000/07/13 21:21:13
*************** typedef struct {
*** 452,458 ****
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
       PARAMS ((CGEN_CPU_DESC, const char *));
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
!      PARAMS ((CGEN_CPU_DESC, int));
  
  /* This struct is used to describe things like register names, etc.  */
  
--- 452,458 ----
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
       PARAMS ((CGEN_CPU_DESC, const char *));
  extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
!      PARAMS ((CGEN_CPU_DESC, unsigned int));
  
  /* This struct is used to describe things like register names, etc.  */
  
Index: opcodes/cgen-asm.c
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-asm.c,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 cgen-asm.c
*** cgen-asm.c	1999/05/03 07:28:59	1.1.1.1
--- cgen-asm.c	2000/07/13 21:21:21
*************** hash_insn_array (cd, insns, count, entsi
*** 66,72 ****
       CGEN_CPU_DESC cd;
       const CGEN_INSN *insns;
       int count;
!      int entsize;
       CGEN_INSN_LIST **htable;
       CGEN_INSN_LIST *hentbuf;
  {
--- 66,72 ----
       CGEN_CPU_DESC cd;
       const CGEN_INSN *insns;
       int count;
!      int entsize ATTRIBUTE_UNUSED;
       CGEN_INSN_LIST **htable;
       CGEN_INSN_LIST *hentbuf;
  {
*************** cgen_asm_lookup_insn (cd, insn)
*** 198,204 ****
  
  const char *
  cgen_parse_keyword (cd, strp, keyword_table, valuep)
!      CGEN_CPU_DESC cd;
       const char **strp;
       CGEN_KEYWORD *keyword_table;
       long *valuep;
--- 198,204 ----
  
  const char *
  cgen_parse_keyword (cd, strp, keyword_table, valuep)
!      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
       const char **strp;
       CGEN_KEYWORD *keyword_table;
       long *valuep;
Index: opcodes/cgen-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-dis.c,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 cgen-dis.c
*** cgen-dis.c	1999/05/03 07:28:59	1.1.1.1
--- cgen-dis.c	2000/07/13 21:21:21
*************** hash_insn_array (cd, insns, count, entsi
*** 43,49 ****
       CGEN_CPU_DESC cd;
       const CGEN_INSN * insns;
       int count;
!      int entsize;
       CGEN_INSN_LIST ** htable;
       CGEN_INSN_LIST * hentbuf;
  {
--- 43,49 ----
       CGEN_CPU_DESC cd;
       const CGEN_INSN * insns;
       int count;
!      int entsize ATTRIBUTE_UNUSED;
       CGEN_INSN_LIST ** htable;
       CGEN_INSN_LIST * hentbuf;
  {
Index: opcodes/cgen-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-opc.c,v
retrieving revision 1.2
diff -c -p -r1.2 cgen-opc.c
*** cgen-opc.c	2000/02/24 23:58:52	1.2
--- cgen-opc.c	2000/07/13 21:21:21
*************** cgen_hw_lookup_by_name (cd, name)
*** 263,269 ****
       CGEN_CPU_DESC cd;
       const char *name;
  {
!   int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
  
    for (i = 0; i < cd->hw_table.num_entries; ++i)
--- 263,269 ----
       CGEN_CPU_DESC cd;
       const char *name;
  {
!   unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
  
    for (i = 0; i < cd->hw_table.num_entries; ++i)
*************** cgen_hw_lookup_by_name (cd, name)
*** 281,289 ****
  const CGEN_HW_ENTRY *
  cgen_hw_lookup_by_num (cd, hwnum)
       CGEN_CPU_DESC cd;
!      int hwnum;
  {
!   int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
  
    /* ??? This can be speeded up.  */
--- 281,289 ----
  const CGEN_HW_ENTRY *
  cgen_hw_lookup_by_num (cd, hwnum)
       CGEN_CPU_DESC cd;
!      unsigned int hwnum;
  {
!   unsigned int i;
    const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
  
    /* ??? This can be speeded up.  */
*************** cgen_operand_lookup_by_name (cd, name)
*** 305,311 ****
       CGEN_CPU_DESC cd;
       const char *name;
  {
!   int i;
    const CGEN_OPERAND **op = cd->operand_table.entries;
  
    for (i = 0; i < cd->operand_table.num_entries; ++i)
--- 305,311 ----
       CGEN_CPU_DESC cd;
       const char *name;
  {
!   unsigned int i;
    const CGEN_OPERAND **op = cd->operand_table.entries;
  
    for (i = 0; i < cd->operand_table.num_entries; ++i)

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