MapServer / MapServer-import

3 stars 2 forks source link

mapparser.c generated does not work for windows #2030

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: assefa Date: 2007/02/15 - 17:39

I tried to build 4.10.1 on Windows with a mapparse.c generated on a linux and
could not do it out of the box : around line 1014 here is what was generated :

...
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
  void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()
    ;
#endif
#endif
{
...

 In the case of windows, I had to remove last ; 

 Not sure if we need to define __cplusplus but in any case, the generated code
is invalid.
tbonfort commented 12 years ago

Author: assefa Date: 2007/02/15 - 17:40

Forgot to mention that after the cahnes, It builds and works properly.
tbonfort commented 12 years ago

Author: dmorissette Date: 2007/02/15 - 19:38

This broken mapparser.c was generated by bison v 2.1 on a Ubuntu system.

I just checked on an older (FC1) system with bison 1.875 and it generates almost
the same block of code as above, but without the stray ';', so it seems that
this problem would have been introcudes in bison between v1.875 and 2.1.

I don't think there is much we can do about this directly in Mapserver (other
than being aware of the issue), so I'll close as WONTFIX.
tbonfort commented 12 years ago

Author: dmorissette Date: 2007/02/15 - 19:53

I Googled for this problem and found a few other places referring to the same
issue and telling their users to stick to bison 1.875 or remove the stray
';''because 2.1 generated files are not compatible with VC++.

However I didn't find anything official about this in bison lists or bugs
reports (well, I simply didn't find any bug tracker).