Is this portable?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Is this portable?
Date: 2007-04-02 19:22:08
Message-ID: 20070402192208.GH13946@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-04-02 19:29:04 Re: Is this portable?
Previous Message Heikki Linnakangas 2007-04-02 19:00:03 CheckpointStartLock starvation