Unexpected behaviour of import ccall "header.h function"
|Reported by:||nh2||Owned by:|
|Type of failure:||Documentation bug||Test Case:|
|Related Tickets:||Differential Rev(s):|
When I write
foreign import ccall "myheader.h myfunction" function :: IO ...
Is GHC supposed to check the existence of the header file, or do anything with it?
Because I can still write
"myheaderBLA.h myfunction" and it doesn't care about the first word (no error, ever, not even in linking, executable builds all fine).
Relatedly, I can write
foreign import ccall "some.rubbish" f :: IO ...
and as long as
"some.rubbish" contains a dot, nothin in the system will ever complain.
carter suggested that maybe names with a dot inside are ignored by a linker.
This leads me to the question: In my example above, is
myheaderBLA.h actually understood as some kind of file and ignored by e.g. GHC, or is it a garbled symbol name? In that case, why does http://www.haskell.org/onlinereport/haskell2010/haskellch8.html suggest
ccall "string.h strlen"? In the other case, why would it suggest this if the
"string.h" part is ignored?