can not build with profiling due to CPP definition name clash with C standard library #3064
Labels
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Your environment
Which OS do you use?
Ubuntu
Which version of GHC do you use and how did you install it?
GHC 9.2.3, installed through ghcup
How is your project built (alternative: link to the project)?
cabal.project.local
:Steps to reproduce
Checkout master, run
cabal build exe:haskell-language-server
Expected behaviour
It should compiles
Actual behaviour
Reason
Dig into the actual
gcc
command issued byghc --make
, we see:But in
<stdio.h>
, there already exists a function calledrename
: https://en.cppreference.com/w/c/io/renameSo this finally lead to this line in the preprocessed C file (because
rename
is replaced by1
)Then of course C compilation fails
Solution
I recommend adding a prefix to all CPP definitions in haskell-language-server executable. For example change
-Drename
to-Dhls_rename
.The text was updated successfully, but these errors were encountered: