Re: Is this portable?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is this portable?
Date: 2007-04-02 19:29:04
Message-ID: 200704021929.l32JT4Q00786@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Can I declare a struct in a function's declaration section? Something
> like this:
>
> static void
> foobar(void)
> {
> struct foo {
> Oid foo;
> int bar;
> };
>
> struct foo baz;
>
> baz.foo = InvalidOid;
> baz.bar = 42;
>
> }
>
> I tried here and GCC does not complain, with -std=c89 -pedantic.

Sure.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-02 19:46:04 Re: CheckpointStartLock starvation
Previous Message Alvaro Herrera 2007-04-02 19:22:08 Is this portable?