This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Fix compile time warning message in libgcc2's CFA code.


Hi Guys,

  The current gcc sources are producing a compile time warning when
  building libgcc2:

gcc/libgcc2.c: In function `next_stack_level':
gcc/libgcc2.c:3659: warning: assignment makes pointer from integer without a cast

  The patch below fixes this.  There are lots of casts going on in the
  expression, but I think that it is now correct.

  Is it OK to apply ?

Cheers
	Nick


2000-07-10  Nick Clifton  <nickc@cygnus.com>

	* libgcc2.c (next_stack_level): Cast result of indirect CFA
	calculation back to void *.

Index: gcc/libgcc2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/libgcc2.c,v
retrieving revision 1.97
diff -p -r1.97 libgcc2.c
*** libgcc2.c	2000/06/26 20:15:07	1.97
--- libgcc2.c	2000/07/10 16:53:40
*************** next_stack_level (void *pc, frame_state 
*** 3712,3719 ****
    else
      caller_udata->cfa = udata->cfa;
    if (caller_udata->indirect)
!     caller_udata->cfa = *(word_type *)((unsigned char *)caller_udata->cfa 
! 				  + caller_udata->base_offset);
    caller_udata->cfa += caller_udata->cfa_offset;
  
    return caller_udata;
--- 3712,3719 ----
    else
      caller_udata->cfa = udata->cfa;
    if (caller_udata->indirect)
!     caller_udata->cfa = (void *) *(word_type *)((unsigned char *)caller_udata->cfa 
! 						+ caller_udata->base_offset);
    caller_udata->cfa += caller_udata->cfa_offset;
  
    return caller_udata;

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