Opened 8 years ago

Closed 3 years ago

#2127 closed feature request (wontfix)

Bad error message for FFI declaration with no -fffi flag

Reported by: tim Owned by:
Priority: normal Milestone:
Component: Compiler (Parser) Version: 6.8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

If I compile:

module Ccall where

import Foreign.C.Types

foreign import ccall "stdio.h putchar"
    putchar :: CInt -> IO CInt

I get:

$ ghc-6.8.1 -c -fext-core Ccall.hs  -no-recomp

Ccall.hs:5:8: parse error on input `import'

A better error message would be to suggest passing the -fffi flag.

Change History (4)

comment:1 Changed 8 years ago by simonmar

  • difficulty set to Unknown
  • Milestone set to _|_
  • Type changed from bug to feature request

comment:2 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:3 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:4 Changed 3 years ago by monoidal

  • Resolution set to wontfix
  • Status changed from new to closed
  • Type of failure set to None/Unknown

It is true that the error is really unhelpful, but now FFI is on by default as a part of the Haskell 2010 standard. I think the ticket is not worth implementing, then.

Note: See TracTickets for help on using tickets.