Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build) - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
Date
Msg-id CAPpHfdtdUfJYJSeihVTWA_rPLeH_RYsA5AhL3U-iPzaFOxU57A@mail.gmail.com
Whole thread Raw
In response to Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
List pgsql-hackers
On Mon, Aug 8, 2011 at 7:43 PM, Alvaro Herrera <alvherre@commandprompt.com> wrote:
Maybe this needs to use the new FLEXIBLE_ARRAY_MEMBER stuff.  Can you try that please?

typedef struct relopt_string
{
relopt_gen gen;
int default_len;
bool default_isnull;
validate_string_relopt validate_cb;
char default_val[1]; /* variable length, zero-terminated */
} relopt_string;

static relopt_string stringRelOpts[] =
...

I doubt variable-length data structure is possible in this case, because we don't have array of pointers to relopt_string, but just array of relopt_string. May be just
char *default_val;
is possible?
 
------
With best regards,
Alexander Korotkov. 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
Next
From: Robert Haas
Date:
Subject: Re: Yes, WaitLatch is vulnerable to weak-memory-ordering bugs