Brad,
I had precisely this problem recently with AST on Solaris. The
answer was to cast the (void *) pointer to (char *) before doing the
arithmetic. I've made this change to hdsstructwrite.c and committed
it both to the trunk and to the keoe branch.
David
On Tue, 22 Aug 2006, Brad Cavanagh wrote:
> When compiling CONVERT on Solaris 8, using the Sun Workshop 6 C compiler,
> I get the following error:
>
> STARLINK> make
> Making all in idl
> make[1]: Entering directory
> `/export/scratch/starlink-cvs/applications/convert/idl'
> source='hdsstructwrite.c' object='hdsstructwrite.lo' libtool=yes \
> DEPDIR=.deps depmode=none /bin/bash ./depcomp \
> /bin/bash ./libtool --tag=CC --mode=compile cc -DPACKAGE_NAME=\"convert\"
> -DPACKAGE_TARNAME=\"convert\" -DPACKAGE_VERSION=\"1.5-4\"
> -DPACKAGE_STRING=\"convert\ 1.5-4\"
> -DPACKAGE_BUGREPORT=\"[log in to unmask]\" -DPACKAGE=\"convert\"
> -DVERSION=\"1.5-4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
> -DHAVE_LIMITS_H=1 -DHAVE_DECL_PATH_MAX=1 -I. -I. -I/star/include -g
> -c -o hdsstructwrite.lo hdsstructwrite.c
> cc -DPACKAGE_NAME=\"convert\" -DPACKAGE_TARNAME=\"convert\"
> -DPACKAGE_VERSION=\"1.5-4\" "-DPACKAGE_STRING=\"convert 1.5-4\""
> -DPACKAGE_BUGREPORT=\"[log in to unmask]\" -DPACKAGE=\"convert\"
> -DVERSION=\"1.5-4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
> -DHAVE_LIMITS_H=1 -DHAVE_DECL_PATH_MAX=1 -I. -I. -I/star/include -g -c
> hdsstructwrite.c -o hdsstructwrite.o
> "hdsstructwrite.c", line 129: cannot do pointer arithmetic on operand of
> unknown size
> cc: acomp failed for hdsstructwrite.c
> make[1]: *** [hdsstructwrite.lo] Error 1
> make[1]: Leaving directory
> `/export/scratch/starlink-cvs/applications/convert/idl'
> make: *** [all-recursive] Error 1
>
>
> The line in question reads as follows:
>
> cmpdata = data + offset;
>
> data is void*, which is presumably what the compiler's complaining about.
>
> Cheers,
> Brad.
>
|