Fixes for compile time warnings.

Nick Clifton nickc@redhat.com
Tue Feb 15 17:27:00 GMT 2005


Hi Guys,

  The cgen generated files in the opcodes were triggering quite a few
  warnings about unused functions and structures, so I am going to
  apply the patch below to fix them.

Cheers
  Nick

cgen/ChangeLog
2005-02-15  Nick Clifton  <nickc@redhat.com>

	* opc-itab.scm (-gen-ifmt-table-1): Add an ATTRIBUTE_UNUSED to
	prevent compile time warning messages.
	* opc-opinst.scm (-gen-operand-instance-table): Likewise.
	* utils-gen.scm (attr-int-gen-defn): Likewise.
	(attr-gen-defn): Likewise.
	* cpu/ip2k.opc (parse_addr16_p): Remove unused function.
	(print_dollarhex16): Remove unused function.

opcodes/ChangeLog
2005-02-15  Nick Clifton  <nickc@redhat.com>

	* cgen-dis.in (print_address): Add an ATTRIBUTE_UNUSED to prevent
	compile time warnings.
	(print_keyword): Likewise.
	(default_print_insn): Likewise.

	* fr30-desc.c: Regenerated.
	* fr30-desc.h: Regenerated.
	* fr30-dis.c: Regenerated.
	* fr30-opc.c: Regenerated.
	* fr30-opc.h: Regenerated.
	* frv-desc.c: Regenerated.
	* frv-dis.c: Regenerated.
	* frv-opc.c: Regenerated.
	* ip2k-asm.c: Regenerated.
	* ip2k-desc.c: Regenerated.
	* ip2k-desc.h: Regenerated.
	* ip2k-dis.c: Regenerated.
	* ip2k-opc.c: Regenerated.
	* ip2k-opc.h: Regenerated.
	* iq2000-desc.c: Regenerated.
	* iq2000-dis.c: Regenerated.
	* iq2000-opc.c: Regenerated.
	* m32r-asm.c: Regenerated.
	* m32r-desc.c: Regenerated.
	* m32r-desc.h: Regenerated.
	* m32r-dis.c: Regenerated.
	* m32r-opc.c: Regenerated.
	* m32r-opc.h: Regenerated.
	* m32r-opinst.c: Regenerated.
	* openrisc-desc.c: Regenerated.
	* openrisc-desc.h: Regenerated.
	* openrisc-dis.c: Regenerated.
	* openrisc-opc.c: Regenerated.
	* openrisc-opc.h: Regenerated.
	* xstormy16-desc.c: Regenerated.
	* xstormy16-desc.h: Regenerated.
	* xstormy16-dis.c: Regenerated.
	* xstormy16-opc.c: Regenerated.
	* xstormy16-opc.h: Regenerated.

Index: cgen/opc-itab.scm
===================================================================
RCS file: /cvs/src/src/cgen/opc-itab.scm,v
retrieving revision 1.11
diff -c -3 -p -r1.11 opc-itab.scm
*** cgen/opc-itab.scm	8 Sep 2003 17:17:22 -0000	1.11
--- cgen/opc-itab.scm	15 Feb 2005 12:41:42 -0000
***************
*** 202,208 ****
    (gen-obj-sanitize
     (ifmt-eg-insn ifmt) ; sanitize based on the example insn
     (string-list
!     "static const CGEN_IFMT " (gen-sym ifmt) " = {\n"
      "  "
      (number->string (ifmt-mask-length ifmt)) ", "
      (number->string (ifmt-length ifmt)) ", "
--- 202,208 ----
    (gen-obj-sanitize
     (ifmt-eg-insn ifmt) ; sanitize based on the example insn
     (string-list
!     "static const CGEN_IFMT " (gen-sym ifmt) " ATTRIBUTE_UNUSED = {\n"
      "  "
      (number->string (ifmt-mask-length ifmt)) ", "
      (number->string (ifmt-length ifmt)) ", "
Index: cgen/opc-opinst.scm
===================================================================
RCS file: /cvs/src/src/cgen/opc-opinst.scm,v
retrieving revision 1.4
diff -c -3 -p -r1.4 opc-opinst.scm
*** cgen/opc-opinst.scm	7 Aug 2003 15:53:58 -0000	1.4
--- cgen/opc-opinst.scm	15 Feb 2005 12:41:42 -0000
***************
*** 49,55 ****
       (sfmt-eg-insn sfmt) ; sanitize based on the example insn
       (string-append
        "static const CGEN_OPINST "
!       (gen-sym sfmt) "_ops[] = {\n"
        (string-map (lambda (op) (-gen-operand-instance op "INPUT"))
  		  ins)
        (string-map (lambda (op)  (-gen-operand-instance op "OUTPUT"))
--- 49,55 ----
       (sfmt-eg-insn sfmt) ; sanitize based on the example insn
       (string-append
        "static const CGEN_OPINST "
!       (gen-sym sfmt) "_ops[] ATTRIBUTE_UNUSED = {\n"
        (string-map (lambda (op) (-gen-operand-instance op "INPUT"))
  		  ins)
        (string-map (lambda (op)  (-gen-operand-instance op "OUTPUT"))
Index: cgen/utils-gen.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils-gen.scm,v
retrieving revision 1.10
diff -c -3 -p -r1.10 utils-gen.scm
*** cgen/utils-gen.scm	16 Jul 2003 05:35:48 -0000	1.10
--- cgen/utils-gen.scm	15 Feb 2005 12:41:42 -0000
***************
*** 14,20 ****
  (define (attr-int-gen-defn attr) 
    (string-append
     "static const CGEN_ATTR_ENTRY " (gen-sym attr)
!    "_attr [] = \n{\n  {\"integer\", " (number->string (attr-default attr)) "},\n  { 0, 0 }\n};\n\n" ))
  
  (define (attr-gen-decl attr)
    (gen-enum-decl (symbol-append (obj:name attr) '-attr)
--- 14,20 ----
  (define (attr-int-gen-defn attr) 
    (string-append
     "static const CGEN_ATTR_ENTRY " (gen-sym attr)
!    "_attr [] ATTRIBUTE_UNUSED = \n{\n  {\"integer\", " (number->string (attr-default attr)) "},\n  { 0, 0 }\n};\n\n" ))
  
  (define (attr-gen-decl attr)
    (gen-enum-decl (symbol-append (obj:name attr) '-attr)
***************
*** 27,33 ****
    (string-append
     "static const CGEN_ATTR_ENTRY "
     (gen-sym attr) "_attr"
!    "[] =\n{\n"
     (string-map (lambda (elm)
  		 (let* ((san (and (pair? elm) (pair? (cdr elm))
  				  (attr-value (cddr elm) 'sanitize #f))))
--- 27,33 ----
    (string-append
     "static const CGEN_ATTR_ENTRY "
     (gen-sym attr) "_attr"
!    "[] ATTRIBUTE_UNUSED =\n{\n"
     (string-map (lambda (elm)
  		 (let* ((san (and (pair? elm) (pair? (cdr elm))
  				  (attr-value (cddr elm) 'sanitize #f))))
Index: cgen/cpu/ip2k.opc
===================================================================
RCS file: /cvs/src/src/cgen/cpu/ip2k.opc,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ip2k.opc
*** cgen/cpu/ip2k.opc	2 Dec 2002 21:53:53 -0000	1.2
--- cgen/cpu/ip2k.opc	15 Feb 2005 12:41:42 -0000
*************** static const char *name PARAMS ((CGEN_CP
*** 77,83 ****
  
  PARSE_FUNC_DECL (parse_fr);
  PARSE_FUNC_DECL (parse_addr16);
- PARSE_FUNC_DECL (parse_addr16_p);
  PARSE_FUNC_DECL (parse_addr16_cjp);
  PARSE_FUNC_DECL (parse_lit8);
  PARSE_FUNC_DECL (parse_bit3);
--- 77,82 ----
*************** parse_addr16 (cd, strp, opindex, valuep)
*** 318,348 ****
  
  
  static const char *
- parse_addr16_p (cd, strp, opindex, valuep)
-      CGEN_CPU_DESC cd;
-      const char **strp;
-      int opindex;
-      long *valuep;
- {
-   const char *errmsg;
-   enum cgen_parse_operand_result result_type;
-   bfd_reloc_code_real_type code = BFD_RELOC_IP2K_PAGE3;
-   bfd_vma value;
-  
-   errmsg = cgen_parse_address (cd, strp, opindex, code,
- 			       & result_type, & value);
-   if (errmsg == NULL)
-     {
-       if ( result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER )
- 	*valuep = (value >> 13) & 0x7;
-       else if ( result_type == CGEN_PARSE_OPERAND_RESULT_QUEUED )
- 	*valuep = value;
-     }
-   return errmsg; 
- }
- 
- 
- static const char *
  parse_addr16_cjp (cd, strp, opindex, valuep)
       CGEN_CPU_DESC cd;
       const char **strp;
--- 317,322 ----
*************** static void name PARAMS ((CGEN_CPU_DESC,
*** 532,538 ****
  PRINT_FUNC_DECL (print_fr);
  PRINT_FUNC_DECL (print_dollarhex);
  PRINT_FUNC_DECL (print_dollarhex8);
- PRINT_FUNC_DECL (print_dollarhex16);
  PRINT_FUNC_DECL (print_dollarhex_addr16h);
  PRINT_FUNC_DECL (print_dollarhex_addr16l);
  PRINT_FUNC_DECL (print_dollarhex_p);
--- 506,511 ----
*************** print_dollarhex8 (cd, dis_info, value, a
*** 624,643 ****
  }
  
  static void
- print_dollarhex16 (cd, dis_info, value, attrs, pc, length)
-      CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
-      PTR dis_info;
-      long value;
-      unsigned int attrs ATTRIBUTE_UNUSED;
-      bfd_vma pc ATTRIBUTE_UNUSED;
-      int length ATTRIBUTE_UNUSED;
- {
-   disassemble_info *info = (disassemble_info *) dis_info;
- 
-   (*info->fprintf_func) (info->stream, "$%04x", value);
- }
- 
- static void
  print_dollarhex_addr16h (cd, dis_info, value, attrs, pc, length)
       CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
       PTR dis_info;
--- 597,602 ----
Index: opcodes/cgen-dis.in
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-dis.in,v
retrieving revision 1.17
diff -c -3 -p -r1.17 cgen-dis.in
*** opcodes/cgen-dis.in	8 Aug 2003 21:21:24 -0000	1.17
--- opcodes/cgen-dis.in	15 Feb 2005 12:42:01 -0000
*************** along with this program; if not, write t
*** 43,57 ****
  static void print_normal
    (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
  static void print_address
!   (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
  static void print_keyword
!   (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
  static void print_insn_normal
    (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
  static int print_insn
    (CGEN_CPU_DESC, bfd_vma,  disassemble_info *, char *, unsigned);
  static int default_print_insn
!   (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
  static int read_insn
    (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
     unsigned long *);
--- 43,57 ----
  static void print_normal
    (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
  static void print_address
!   (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED;
  static void print_keyword
!   (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED;
  static void print_insn_normal
    (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
  static int print_insn
    (CGEN_CPU_DESC, bfd_vma,  disassemble_info *, char *, unsigned);
  static int default_print_insn
!   (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED;
  static int read_insn
    (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
     unsigned long *);
  



More information about the Binutils mailing list