On 26/08/2011 17:29, Paul Eggert wrote:
Can't you compile with the -xc99 option?  The Sun documentation says it's
supported, even with that old compiler:

http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e

'configure' should have deduced the -xc99 option for you; it tries
'-xc99=all' early on.  Does that not work for you?  The documentation
says '-xc99=%all' is required, but as I recall, the '%' was optional
even way back when.

That doesn't seem to be quite enough unfortunately:

> cc -V
cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18
> dirs
~/src/gnu/dist/coreutils-8.9/lib
> make -n heap.o
echo "  CC      " heap.o;source='heap.c' object='heap.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \
cc  -I.   -D_REENTRANT   -O -xc99=%all -c -o heap.o heap.c
> make heap.o
  CC       heap.o
"heap.c", line 99: syntax error before or at: void
"heap.c", line 103: undefined symbol: top
"heap.c", line 103: warning: improper pointer/integer combination: op "="
cc: acomp failed for heap.c
make: *** [heap.o] Error 2
Exit 2
> sed -n '96,103p' heap.c
  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;
>


If you look at the list of supported C99 features, it's:


No mixing of declarations with statements.  Ah well, this should be the last time I have to do this.

Rob
-- 
E-Mail:	Rob.McMahon@warwick.ac.uk		PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England