Re: orafce does NOT build with Sun Studio compiler

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mayuresh Nirhali <Mayuresh(dot)Nirhali(at)Sun(dot)COM>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: orafce does NOT build with Sun Studio compiler
Date: 2008-06-05 06:13:47
Message-ID: 10513.1212646427@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mayuresh Nirhali <Mayuresh(dot)Nirhali(at)Sun(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mayuresh Nirhali 2008-06-05 06:18:32 Re: orafce does NOT build with Sun Studio compiler
Previous Message Simon Riggs 2008-06-05 05:17:47 Re: [PERFORM] Outer joins and equivalence