Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-04-02 19:46:04
Subject: Re: CheckpointStartLock starvation
Previous:From: Alvaro HerreraDate: 2007-04-02 19:22:08
Subject: Is this portable?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group