[committed] Fix some compile warnings

Ulrich Weigand weigand@i1.informatik.uni-erlangen.de
Thu Aug 19 22:25:00 GMT 2004


Hello,

this fixes up a couple of (otherwise harmless) compiler warnings
in libgcc code.  Thanks to Andreas Jaeger for noticing these.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
applied to mainline as obvious.

Bye,
Ulrich


ChangeLog:

	* unwind-dw2-fde.c (get_cie_encoding): Cast argument to strlen
	to eliminate warning.
	(linear_search_fdes): Declare p as unsigned.
	(binary_search_mixed_encoding_fdes): Likewise.
	* unwind-dw2.c (get_cie_encoding): Cast argument to strlen
	to eliminate warning.
	* config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Add missing
	type cast.

Index: gcc/unwind-dw2-fde.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2-fde.c,v
retrieving revision 1.27
diff -c -p -r1.27 unwind-dw2-fde.c
*** gcc/unwind-dw2-fde.c	20 May 2004 22:34:58 -0000	1.27
--- gcc/unwind-dw2-fde.c	18 Aug 2004 01:25:19 -0000
*************** get_cie_encoding (const struct dwarf_cie
*** 273,279 ****
    if (aug[0] != 'z')
      return DW_EH_PE_absptr;
  
!   p = aug + strlen (aug) + 1;		/* Skip the augmentation string.  */
    p = read_uleb128 (p, &utmp);		/* Skip code alignment.  */
    p = read_sleb128 (p, &stmp);		/* Skip data alignment.  */
    if (cie->version == 1)		/* Skip return address column.  */
--- 273,279 ----
    if (aug[0] != 'z')
      return DW_EH_PE_absptr;
  
!   p = aug + strlen ((const char *)aug) + 1; /* Skip the augmentation string.  */
    p = read_uleb128 (p, &utmp);		/* Skip code alignment.  */
    p = read_sleb128 (p, &stmp);		/* Skip data alignment.  */
    if (cie->version == 1)		/* Skip return address column.  */
*************** linear_search_fdes (struct object *ob, c
*** 808,814 ****
        else
  	{
  	  _Unwind_Ptr mask;
! 	  const char *p;
  
  	  p = read_encoded_value_with_base (encoding, base,
  					    this_fde->pc_begin, &pc_begin);
--- 808,814 ----
        else
  	{
  	  _Unwind_Ptr mask;
! 	  const unsigned char *p;
  
  	  p = read_encoded_value_with_base (encoding, base,
  					    this_fde->pc_begin, &pc_begin);
*************** binary_search_single_encoding_fdes (stru
*** 878,884 ****
        size_t i = (lo + hi) / 2;
        const fde *f = vec->array[i];
        _Unwind_Ptr pc_begin, pc_range;
!       const char *p;
  
        p = read_encoded_value_with_base (encoding, base, f->pc_begin,
  					&pc_begin);
--- 878,884 ----
        size_t i = (lo + hi) / 2;
        const fde *f = vec->array[i];
        _Unwind_Ptr pc_begin, pc_range;
!       const unsigned char *p;
  
        p = read_encoded_value_with_base (encoding, base, f->pc_begin,
  					&pc_begin);
*************** binary_search_mixed_encoding_fdes (struc
*** 906,912 ****
        size_t i = (lo + hi) / 2;
        const fde *f = vec->array[i];
        _Unwind_Ptr pc_begin, pc_range;
!       const char *p;
        int encoding;
  
        encoding = get_fde_encoding (f);
--- 906,912 ----
        size_t i = (lo + hi) / 2;
        const fde *f = vec->array[i];
        _Unwind_Ptr pc_begin, pc_range;
!       const unsigned char *p;
        int encoding;
  
        encoding = get_fde_encoding (f);
Index: gcc/unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.43
diff -c -p -r1.43 unwind-dw2.c
*** gcc/unwind-dw2.c	9 Aug 2004 20:31:41 -0000	1.43
--- gcc/unwind-dw2.c	18 Aug 2004 01:25:19 -0000
*************** extract_cie_info (const struct dwarf_cie
*** 262,268 ****
  		  _Unwind_FrameState *fs)
  {
    const unsigned char *aug = cie->augmentation;
!   const unsigned char *p = aug + strlen (aug) + 1;
    const unsigned char *ret = NULL;
    _Unwind_Word utmp;
  
--- 262,268 ----
  		  _Unwind_FrameState *fs)
  {
    const unsigned char *aug = cie->augmentation;
!   const unsigned char *p = aug + strlen ((const char *)aug) + 1;
    const unsigned char *ret = NULL;
    _Unwind_Word utmp;
  
Index: gcc/config/s390/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/linux.h,v
retrieving revision 1.35
diff -c -p -r1.35 linux.h
*** gcc/config/s390/linux.h	11 Jul 2004 11:49:23 -0000	1.35
--- gcc/config/s390/linux.h	18 Aug 2004 01:25:20 -0000
*************** Software Foundation, 59 Temple Place - S
*** 191,197 ****
  									\
      if (signo_ && (*signo_ == 11 || *signo_ == 7))			\
        {									\
! 	(FS)->regs.reg[33].loc.exp = regs_->psw_addr + 1;		\
  	(FS)->regs.reg[32].loc.offset = 				\
  		(long)&(FS)->regs.reg[33].loc.exp - new_cfa_;		\
        }									\
--- 191,198 ----
  									\
      if (signo_ && (*signo_ == 11 || *signo_ == 7))			\
        {									\
! 	(FS)->regs.reg[33].loc.exp = 					\
! 		(unsigned char *)regs_->psw_addr + 1;			\
  	(FS)->regs.reg[32].loc.offset = 				\
  		(long)&(FS)->regs.reg[33].loc.exp - new_cfa_;		\
        }									\
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gcc-patches mailing list