Re: Is this portable? - Mailing list pgsql-hackers

From Zdenek Kotala
Subject Re: Is this portable?
Date
Msg-id 46115E0D.7020208@sun.com
Whole thread Raw
In response to Is this portable?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Is this portable?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.
> 

It works fine with Sun Studio 11.
    Zdenek


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CheckpointStartLock starvation
Next
From: Bruce Momjian
Date:
Subject: Re: So are we calling it: Feature Freeze?