This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Warning elimination patch in sched.c
- To: egcs at cygnus dot com
- Subject: Warning elimination patch in sched.c
- From: Peter Schmid <schmid at ltoi dot iap dot physik dot tu-darmstadt dot de>
- Date: Mon, 9 Mar 1998 20:27:02 +0100 (MEST)
While compiling gcc/sched.c I get the warning:
sched.c: In function `schedule_block':
sched.c:3138: warning: passing arg 4 of `qsort' from incompatible pointer type
sched.c:3233: warning: passing arg 4 of `qsort' from incompatible pointer type
The following patch eliminates the warning.
Perhaps something like:
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
should also be included, as in c-parse.c.
Peter Schmid
Mon Mar 9 19:34:17 1998 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
* sched.c: change rank_for_schedule prototype to
(const void*,const void*) to avoid passing arg 4 of `qsort' incompatible
pointer type warning
*** gcc/sched.c~ Fri Feb 20 14:24:50 1998
--- gcc/sched.c Mon Mar 9 20:22:55 1998
*************** static void sched_analyze_2 PROTO((rtx,
*** 322,328 ****
static void sched_analyze_insn PROTO((rtx, rtx, rtx));
static int sched_analyze PROTO((rtx, rtx));
static void sched_note_set PROTO((int, rtx, int));
! static int rank_for_schedule PROTO((rtx *, rtx *));
static void swap_sort PROTO((rtx *, int));
static void queue_insn PROTO((rtx, int));
static int birthing_insn_p PROTO((rtx));
--- 322,328 ----
static void sched_analyze_insn PROTO((rtx, rtx, rtx));
static int sched_analyze PROTO((rtx, rtx));
static void sched_note_set PROTO((int, rtx, int));
! static int rank_for_schedule PROTO((const void *, const void *));
static void swap_sort PROTO((rtx *, int));
static void queue_insn PROTO((rtx, int));
static int birthing_insn_p PROTO((rtx));
*************** sched_note_set (b, x, death)
*** 1859,1867 ****
unstable. */
static int
! rank_for_schedule (x, y)
! rtx *x, *y;
{
rtx tmp = *y;
rtx tmp2 = *x;
rtx link;
--- 1859,1869 ----
unstable. */
static int
! rank_for_schedule (xv, yv)
! const void *xv, *yv;
{
+ rtx *x = (rtx *) xv;
+ rtx *y = (rtx *) yv;
rtx tmp = *y;
rtx tmp2 = *x;
rtx link;