[SAC-HELP] gcc compiler error under MacOs 10.7.3

Dorman, Leroy ldorman at ucsd.edu
Sat Mar 31 03:03:04 PDT 2012


Attempting to compile sac-101.5c using gcc version i686-apple-darwin11-llvm-gcc-4.2 under Macos 10.7,3,
I get a series of compiler errors stemming from the following code in hdr.h

I want to compile this so I can run SAC under  the debugger to track down problems.

gcc -DHAVE_CONFIG_H -I. -I../inc           -I../inc -I../libedit/include  -DDOINITS -c ./dff/hdrfld.c -o dff/hdrfld_io.o
In file included from ./dff/hdrfld.c:12:
../inc/hdr.h:287: error: initializer element is not constant
../inc/hdr.h:288: error: initializer element is not constant
../inc/hdr.h:289: error: initializer element is not constant

The offending lines follow the ifdef below.


#ifdef DOINITS
        float *const a          = (float*)((char*)cmhdr.fhdr +  32);
        float *const arrivl     = (float*)((char*)cmhdr.fhdr +  32);
        float *const az         = (float*)((char*)cmhdr.fhdr + 204);
And many more follow.

Is there an easy way to fix this?

I am neither a skilled C coder nor Mac user.

LeRoy Dorman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20120331/900ea2f4/attachment.html>


More information about the sac-help mailing list