Warning patch

Jason Merrill jason@cygnus.com
Fri Jun 5 01:16:00 GMT 1998


Do all C compilers support cast to void?

1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>

	* tree.h (TREE_VEC_END): Cast unused value to void.

	* i386.c (print_operand): Use %lx for long operand.

Index: tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.h,v
retrieving revision 1.34
diff -c -p -r1.34 tree.h
*** tree.h	1998/05/22 20:58:14	1.34
--- tree.h	1998/06/05 07:51:11
*************** struct tree_list
*** 646,652 ****
  /* In a TREE_VEC node.  */
  #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
  #define TREE_VEC_ELT(NODE,I) (TREE_VEC_CHECK (NODE)->vec.a[I])
! #define TREE_VEC_END(NODE) (TREE_VEC_CHECK (NODE),&((NODE)->vec.a[(NODE)->vec.length]))
  
  struct tree_vec
  {
--- 646,652 ----
  /* In a TREE_VEC node.  */
  #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
  #define TREE_VEC_ELT(NODE,I) (TREE_VEC_CHECK (NODE)->vec.a[I])
! #define TREE_VEC_END(NODE) ((void) TREE_VEC_CHECK (NODE),&((NODE)->vec.a[(NODE)->vec.length]))
  
  struct tree_vec
  {
Index: config/i386/i386.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.26
diff -c -p -r1.26 i386.c
*** config/i386/i386.c	1998/05/21 19:12:19	1.26
--- config/i386/i386.c	1998/06/05 07:51:11
*************** print_operand (file, x, code)
*** 3373,3379 ****
        REAL_VALUE_FROM_CONST_DOUBLE (r, x);
        REAL_VALUE_TO_TARGET_SINGLE (r, l);
        PRINT_IMMED_PREFIX (file);
!       fprintf (file, "0x%x", l);
      }
  
   /* These float cases don't actually occur as immediate operands. */
--- 3373,3379 ----
        REAL_VALUE_FROM_CONST_DOUBLE (r, x);
        REAL_VALUE_TO_TARGET_SINGLE (r, l);
        PRINT_IMMED_PREFIX (file);
!       fprintf (file, "0x%lx", l);
      }
  
   /* These float cases don't actually occur as immediate operands. */



More information about the Gcc-patches mailing list