Re: gmake check fails on Solaris 8 with Sun cc - Mailing list pgsql-hackers

From Tom Lane
Subject Re: gmake check fails on Solaris 8 with Sun cc
Date
Msg-id 6405.985479425@sss.pgh.pa.us
Whole thread Raw
In response to gmake check fails on Solaris 8 with Sun cc  (Steve Nicolai <snicolai@mac.com>)
List pgsql-hackers
Steve Nicolai <snicolai@mac.com> writes:
> Continuing on my quest to get 7.1 to build on Solaris 8 with
> Sun's cc 5.0, I found an alignment problem in
> backend/access/heap/tuptoaster.c

Good catch.  I fixed a couple similar problems (assuming that a local
"char buffer[N]" object would be aligned on better-than-char boundaries)
in xlog.c not long ago.  I wonder if any others are lurking?

> -       char            chunk_data[VARHDRSZ + TOAST_MAX_CHUNK_SIZE];
> +       union {
> +               varattrib       a;
> +               char            d[VARHDRSZ + TOAST_MAX_CHUNK_SIZE];
> +       } chunk_data;

This is pretty ugly, it'd be better to use a struct of a struct-varlena
header followed by a char[TOAST_MAX_CHUNK_SIZE] data area.  Will fix.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgindent run?
Next
From: ncm@zembu.com (Nathan Myers)
Date:
Subject: Re: RELEASE STOPPER? nonportable int64 constant s in pg_crc.c