Re: orafce does NOT build with Sun Studio compiler - Mailing list pgsql-hackers

From Tom Lane
Subject Re: orafce does NOT build with Sun Studio compiler
Date
Msg-id 10513.1212646427@sss.pgh.pa.us
Whole thread Raw
In response to orafce does NOT build with Sun Studio compiler  (Mayuresh Nirhali <Mayuresh.Nirhali@Sun.COM>)
Responses Re: orafce does NOT build with Sun Studio compiler  (Mayuresh Nirhali <Mayuresh.Nirhali@Sun.COM>)
List pgsql-hackers
Mayuresh Nirhali <Mayuresh.Nirhali@Sun.COM> writes:
> Sun Studio does not like array declarations with null as dimenstion.
> So, In pipe.c we have,

> typedef struct
> {
>         LWLockId shmem_lock;
>         pipe *pipes;
>         alert_event *events;
>         alert_lock *locks;
>         size_t size;
>         unsigned int sid;
>         char data[];                   /* line 149 */
> } sh_memory;

Most C compilers don't like that either.  The standard locution is
something like
         char data[1];                   /* VARIABLE LENGTH ARRAY */

where you just comment to the human reader that the array is not always
of length 1.  This has some implications for sizeof() computations.
There are lots and lots of examples in the existing Postgres code.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Mayuresh Nirhali
Date:
Subject: orafce does NOT build with Sun Studio compiler
Next
From: Simon Riggs
Date:
Subject: pg_dump restore time and Foreign Keys