Closed nkpart closed 11 years ago
To the untrained eye (mine), this all seems a bit weird. But here is fix for #36 (and the GHC ticket https://ghc.haskell.org/trac/ghc/ticket/8528).
I think whenever the ALEX_IF_GHC* macros are used, a blank line needs to precede them.
To reproduce the error and verify the fix:
gcc
Use a shim for gcc to enable switching (this is my ~/bin/gcc)
#!/bin/sh /usr/bin/gcc $@
Check gcc, for now it should be clang:
gcc --version ... Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) ...
Build and test:
$ cd /path/to/alex $ cabal configure --enable-tests $ cabal build $ ./dist/build/tests/tests # Passes
Now switch gcc over to a real gcc:
#!/bin/sh /usr/bin/gcc-4.8 $@
And run tests again (without recompiling!)
$ gcc --version gcc-4.8 (GCC) 4.8.2 $ ./dist/build/tests/tests
Observe all the errors. Like this one:
simple.g.hs:360:0: error: #else without #if -- INTERNALS and main scanner engine ^
With this patch these go away. For now. This is all pretty messy and easy to break in the future. There might be another way that works.
Could the blank line contain a comment? Or failing that, a comment preceding the blank line to avoid someone removing it in the future would be good.
Looks good. Thanks!
To the untrained eye (mine), this all seems a bit weird. But here is fix for #36 (and the GHC ticket https://ghc.haskell.org/trac/ghc/ticket/8528).
I think whenever the ALEX_IF_GHC* macros are used, a blank line needs to precede them.
To reproduce the error and verify the fix:
gcc
will now really be clang.Use a shim for gcc to enable switching (this is my ~/bin/gcc)
Check gcc, for now it should be clang:
Build and test:
Now switch gcc over to a real gcc:
And run tests again (without recompiling!)
Observe all the errors. Like this one:
With this patch these go away. For now. This is all pretty messy and easy to break in the future. There might be another way that works.