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

From Alvaro Herrera
Subject Re: Is this portable?
Date
Msg-id 20070402211958.GL13946@alvh.no-ip.org
Whole thread Raw
In response to Re: Is this portable?  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark wrote:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
> 
> > Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> >> Alvaro Herrera wrote:
> >>> Can I declare a struct in a function's declaration section?
> >
> >> It works fine with Sun Studio 11.
> >
> > AFAICT it's required by the original K&R C book.
> 
> IIRC there's something odd about the scope of the declared struct label.
> 
> Something like it previously extended to the end of the file but post-ANSI was
> limited to the scope it's declared in (including very limited scopes where it
> would be useless such as in function parameters).

Hmm, thanks everybody.  I was just going to say "bummer!" because I
needed to build a qsort comparator for these, but then I realized that
it's better if I keep worker and launcher database structs separate --
the only field they use in common is the Oid anyway.

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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Questions about pid file creation code
Next
From: Bruce Momjian
Date:
Subject: Re: Invalid to_date patterns (was: [PATCHES] [GENERAL] ISO week dates)