Subject: Parse error: Compile coreutils 8.9 with gcc 2.95.3

From: Wolfgang Steinwender <[email-masked]>
Date: Fri, 01 Jul 2011 10:43:54 +0200

Hi,

compiling coreutils 8.9 with gcc 2.95.3:

heap.c: In function `heap_remove_top':
heap.c:99: parse error before `void'
heap.c:103: `top' undeclared (first use in this function)
heap.c:103: (Each undeclared identifier is reported only once
heap.c:103: for each function it appears in.)

I hat to change this:

void *
heap_remove_top (struct heap *heap)
{
  if (heap->count == 0)
    return NULL;

  void *top = heap->array[1];
  heap->array[1] = heap->array[heap->count--];
  heapify_down (heap->array, heap->count, 1, heap->compare);

  return top;
}

to this:

void *
heap_remove_top (struct heap *heap)
{
  void* top;

  if (heap->count == 0)
    return NULL;

  top = heap->array[1];
  heap->array[1] = heap->array[heap->count--];
  heapify_down (heap->array, heap->count, 1, heap->compare);

  return top;
}

The problem is also in the latest git version.

Thanks,
W. Steinwender