Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,242
    • Issues 5,242
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 570
    • Merge requests 570
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8650
Closed
Open
Issue created Jan 05, 2014 by Niklas Hambüchen@nh2Reporter

Unexpected behaviour of import ccall "header.h function"

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?

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mail@nh2.me
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking