Re: problems compiling on solaris - Mailing list pgsql-ports

From Tom Lane
Subject Re: problems compiling on solaris
Date
Msg-id 25401.1080323983@sss.pgh.pa.us
Whole thread Raw
In response to problems compiling on solaris  (Alan Stange <stange@rentec.com>)
List pgsql-ports
Alan Stange <stange@rentec.com> writes:
> I'm trying to compile pg7.4.1 on Solaris using the Sun compilers.   All
> works fine except that I get this error in tuptoaster.c:

> "tuptoaster.c", line 831: member can not have variably modified type: data
> cc: acomp failed for tuptoaster.c

That's bizarre.  It's pointing at this declaration:

    struct
    {
        struct varlena hdr;
        char        data[TOAST_MAX_CHUNK_SIZE];
    }            chunk_data;

The only thing I can think of is that your compiler must be too stupid
to reduce the TOAST_MAX_CHUNK_SIZE expression to a compile-time
constant.  I'd report that to Sun as a compiler bug --- this code has
been like this for a good long time, and no one has ever reported a
compiler unable to deal with it before.

A short-term workaround for you could be to compute TOAST_MAX_CHUNK_SIZE
by hand and change its #define in src/include/access/tuptoaster.h
to be a simple constant.

            regards, tom lane

pgsql-ports by date:

Previous
From: Alan Stange
Date:
Subject: problems compiling on solaris
Next
From: Tom Lane
Date:
Subject: Re: Buggy make files for Solaris 9 64bit builds: version 7.4.1 and 7.4.2