When creating either a Lexer.x
or a Parser.y
parser using the Alex lexer generator or the Happy parser generator, compiling those into Haskell files, and compiling those into object files, by default this will generate the following "warnings":
$ ghc Lexer
line-map.c: file "<command-line>" left but not entered
line-map.c: file "<command-line>" left but not entered
[1 of 1] Compiling Lexer ( Lexer.hs, Lexer.o )
$ happy Parser.y
$ ghc Parser
line-map.c: file "<command-line>" left but not entered
line-map.c: file "<command-line>" left but not entered
[2 of 2] Compiling Parser ( Parser.hs, Parser.o )
Those lines occur as a result of the following lines embedded in the generated .hs
files:
{-# LINE 1 "<command-line>" #-}
Why are those lines included, and is there a way to suppress those messages in case the command-line is not apparently used for anything in the generated lexer and parser?
Googling "left but not entered" suggests that messages like this indicate a misconfigured
gcc
. Here is the code in Apple's version which generates the message:(from http://www.opensource.apple.com/source/gcc/gcc-5484/libcpp/line-map.c )
Here "ICE" refers to "internal compiler error".
The #LINE directives are inserted so that ghc can report errors based on the locations in the .x or .y files. It says that the following line is really a certain line from another file. The #LINE directives for the pseudo file names
<command-line>
and<built-in>
can be ignored because they are always immediately followed by a #LINE directive for a real file name, e.g.:As a test you can simply remove the #LINE directives for
<command-line>
and see if the warnings go away. I would also try re-installing/upgrading your gcc and/or your Haskell Platform.