Re: Is this portable?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is this portable?
Date: 2007-04-02 21:19:58
Message-ID: 20070402211958.GL13946@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-04-02 21:27:23 Re: Invalid to_date patterns (was: [PATCHES] [GENERAL] ISO week dates)
Previous Message Bruce Momjian 2007-04-02 21:18:57 Re: pgbench transaction timestamps