Bug 3882 - GW: WebCore does not compile using bison 2.0
Summary: GW: WebCore does not compile using bison 2.0
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks: 3250
  Show dependency treegraph
 
Reported: 2005-07-06 18:48 PDT by Eric Seidel (no email)
Modified: 2005-07-07 00:47 PDT (History)
0 users

See Also:


Attachments
A trivial fix for 2.0 compatibility. (980 bytes, patch)
2005-07-07 00:19 PDT, Eric Seidel (no email)
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-07-06 18:48:36 PDT
#define YYMAXDEPTH 0

causes a later warning when compiling the code
(<= comparison with 0 is always true), which breaks the build.

Still investigating solutions.
Comment 1 Eric Seidel (no email) 2005-07-06 19:00:56 PDT
6:46pm] toby: YYINITDEPTH is what the bison author suggested when i emailed
[6:46pm] toby: i.e. #define YYMAXDEPTH YYINITDEPTH

I also asked bdash to try removing the line and seeing if it still compiled under bison 1.3.  He said it did.

I'm not yet sure what #define YYMAXDEPTH 0 was supposed to accomplish.
Comment 2 Eric Seidel (no email) 2005-07-07 00:02:46 PDT
My best understanding is that 
#define YYMAXDEPTH 0
was actually just asking bison to use it's default value (under some previous version of bison).

I think we inherited this line all the way from from initial import from khtml.

http://www.mico.org/pipermail/mico-devel/2003-June/007336.html
aids my suspicion that this is actually just setting the default value.

Attached a fix.
Comment 3 Eric Seidel (no email) 2005-07-07 00:18:33 PDT
bdash confirmed this further for me:

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

used to be generated by bison 1.3 now the 

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

is missing from 2.0's generation.

Comparing the generated output you see exactly this:

-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
Comment 4 Eric Seidel (no email) 2005-07-07 00:19:51 PDT
Created attachment 2844 [details]
A trivial fix for 2.0 compatibility.
Comment 5 Maciej Stachowiak 2005-07-07 00:33:17 PDT
Comment on attachment 2844 [details]
A trivial fix for 2.0 compatibility.

r=me

but just to be on the safe side make sure the layout tests pass.