Menu

#473 bison 2.4.1 error when invoking m4

Bison
open
GnuWin
None
7
2014-10-29
2009-05-08
No

I compile MySQL from source with Visual Studio. The project contains a custom step that generates parser from sql_yacc.yy and uses bison for it.

After upgrading bison to 2.4.1, compilation hangs after m4 invoked by bison outputs error messages:

1>m4: cannot open Files': No such file or directory 1>m4: cannot open(x86)\GnuWin32/share/bison': No such file or directory
1>m4: cannot open C:\Program': No such file or directory 1>m4: cannot openFiles': No such file or directory
1>m4: cannot open `(x86)\GnuWin32/share/bison/m4sugar/m4sugar.m4': No such file
or directory

Process Explorer shows that
bison that invokes m4 with the following command line:
m4 -I C:\Program Files (x86)\GnuWin32/share/bison C:\Program Files (x86)\GnuWin32/share/bison/m4sugar/m4sugar.m4 - C:\Program Files (x86)\GnuWin32/share/bison/bison.m4 C:\Program Files (x86)\GnuWin32/share/bison/c-skel.m4

It looks line command line arguments containing spaces must be enclosed in quotes.

Discussion

  • Vladislav Vaintroub

    Any news?

     
  • Julien Blitte

    Julien Blitte - 2012-08-14

    Hello,

    The bug is located in the create_subpipe() function, not in bison software itself.
    create_subpipe() is referenced in function output_skeleton() in file src/output.c and called with good arguments.

    Bug seems to be solved in newver version, since the use of create_pipe_bidi() function.

    Julien B.

     

    Last edit: Julien Blitte 2012-08-14
  • Julien Blitte

    Julien Blitte - 2012-08-14

    Hello,

    I have checked, implementation of create_pipe(), the code of function is correct but it
    calls the subroutine _spawnvp() in library msvcrt.dll (Microsoft runtime for C).
    I have double checked with a debugger, the call is done correctly.

    So the bug must be located in the function _spawnvp(), and it's definitively not a Bison bug but Microsoft issue with _spawnvp() function in their C library :-(

    New implementation with create_pipe_bidi() should solve this issue.

    Julien

     
  • Anonymous

    Anonymous - 2012-08-15

    Hello again,

    I worked last night on this and I fixed the executable itself in binary.
    I have not all the libraries, tools and courage to recompile the last version, so I patched last GnuWin32 compiled version of Bison (2.4.1).

    Fixed version of Bison binary can be found here:
    http://marin.jb.free.fr/bison/bison-2.4.1-modified.zip

    It works from my side; it does compile with binary being into C:\Program Files...

    As it was technicaly interesting (for me at least), I wrote an article regarding the implemented fix. If it may interest someone else, detailed explanation is here:
    http://marin.jb.free.fr/bison

    Julien

     

    Last edit: Anonymous 2018-10-12
  • Anonymous

    Anonymous - 2014-10-29

    thank you very much vincent kasyoki kenya gis C++ programmer

     

    Last edit: Anonymous 2018-10-12