Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)
Date: 2011-08-08 15:50:53
Message-ID: CAPpHfdtdUfJYJSeihVTWA_rPLeH_RYsA5AhL3U-iPzaFOxU57A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 8, 2011 at 7:43 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)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.

In response to

Responses

Browse pgsql-hackers by date

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