Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Creager <robert(at)logicalchaos(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem
Date: 2009-09-07 22:08:25
Message-ID: 11118.1252361305@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: buildfarm-members pgsql-general pgsql-hackers

Robert Creager <robert(at)logicalchaos(dot)org> writes:
> On Sep 7, 2009, at 1:18 PM, Tom Lane wrote:
>> Robert Creager <robert(at)logicalchaos(dot)org> writes:
>>> extern yy_size_t yyleng;
>>
>> Bizarre --- my copy of flex 2.5.35 definitely puts out "int", and
>> so does everybody else's. Did Apple take it on their own head to
>> change this?

> Apparently so - the /opt version is from macports. It works.

[ Well, I knew I was going to be buying a copy of Snow Leopard sometime
soon. One trip to the Apple store later ... ]

Yeah, I've confirmed this. It appears that Apple has absorbed this
as-yet-unreleased upstream patch into their "2.5.35" version:
http://flex.cvs.sourceforge.net/viewvc/flex/flex/flex.skl?r1=2.212&r2=2.213

This is probably not the brightest thing the flex developers have ever
done, as there is now absolutely no way to predict the type of yyleng
externally to the generated scan.c file. They might as well not export
it at all.

However, I think we can work around it. AFAICS, the only reason ecpg
has an extern for yyleng is because preproc.y's make_name() uses it,
and there doesn't seem to be any compelling reason why that function
shouldn't just do "mm_strdup(yytext)" instead. I don't see any other
places where we are referring to yyleng outside of a scanner file.
(Alternatively, make_name() could be moved into pgc.l, but I doubt
it's worth the work to avoid one extra strlen calculation.)

Presumably, versions of flex containing this change will start to show
up at other places besides Apple sometime soon. So I'm thinking we
need to back-patch the fix to whatever branches we think are likely
to get compiled from CVS on newer platforms. Any feelings about that?
Should I just hit everything back to 7.4 to be safe?

regards, tom lane

In response to

Responses

Browse buildfarm-members by date

  From Date Subject
Next Message Robert Creager 2009-09-07 22:12:31 Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem
Previous Message Dave Page 2009-09-07 20:41:28 Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem

Browse pgsql-general by date

  From Date Subject
Next Message Robert Creager 2009-09-07 22:12:31 Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem
Previous Message Alban Hertroys 2009-09-07 21:16:04 Re: More Snow Leopard problems...

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Creager 2009-09-07 22:12:31 Re: [Pgbuildfarm-members] Snow Leopard bison/flex build problem
Previous Message Alvaro Herrera 2009-09-07 21:42:10 manually setting the command tag (was Re: 8.4: suppress_redundant_updates trigger vs. "Upsert" logic)