This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
heapsort in frame.c, conflict with BSD/OS definition
- To: egcs at cygnus dot com
- Subject: heapsort in frame.c, conflict with BSD/OS definition
- From: Shigeya Suzuki <shigeya at foretune dot co dot jp>
- Date: Sat, 18 Apr 1998 23:19:06 +0900
I was trying to build latest CVS snapshot (98/04/18 22:06 JST) and
found following.
BSD/OS (and probably others) have heapsort definition in stdlib.h. And
it is now conflicting with definition in gcc/frame.c.
in stdlib.h, it defined as:
int heapsort __P((void *, size_t, size_t,
int (*)(const void *, const void *)));
and in gcc/frame.c,
/* This is O(n log(n)). */
static inline void
heapsort (fde_vector *erratic)
{
so conflicting.
I guess there are similar problem in other platforms. How I can modify
this? My quick and dirty solution is change heapsort function name as
follows..
Shigeya
*** ../egcs-latest/egcs/gcc/frame.c.FCS Sat Apr 18 22:07:12 1998
--- ../egcs-latest/egcs/gcc/frame.c Sat Apr 18 23:17:49 1998
***************
*** 271,277 ****
/* This is O(n log(n)). */
static inline void
! heapsort (fde_vector *erratic)
{
/* For a description of this algorithm, see:
Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
--- 271,277 ----
/* This is O(n log(n)). */
static inline void
! inline_heapsort (fde_vector *erratic)
{
/* For a description of this algorithm, see:
Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
***************
*** 366,372 ****
fde_split (&accu->linear, &accu->erratic);
if (accu->linear.count + accu->erratic.count != count)
abort ();
! heapsort (&accu->erratic);
fde_merge (&accu->linear, &accu->erratic);
free (accu->erratic.array);
return accu->linear.array;
--- 366,372 ----
fde_split (&accu->linear, &accu->erratic);
if (accu->linear.count + accu->erratic.count != count)
abort ();
! inline_heapsort (&accu->erratic);
fde_merge (&accu->linear, &accu->erratic);
free (accu->erratic.array);
return accu->linear.array;