Ticket #3742 (closed merge: fixed)

Opened 3 years ago

Last modified 3 years ago

redundant space in FFI imports rejected by 6.12

Reported by: duncan Owned by: igloo
Priority: normal Milestone: 6.12.2
Component: Compiler (Parser) Version: 6.12.1 RC1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

GHC 6.10 and older accepted this code:

foreign import ccall unsafe " g_get_application_name"
  g_get_application_name :: (IO (Ptr CChar))

GHC 6.12 now rejects it with

glib/System/Glib/Utils.chs:81:28: Malformed entity string

The problem is the leading space in the C entity string. This code is generated by c2hs which is doing header ++ " " ++ ident however the header may be empty.

We should probably allow this code, though possibly with a warning. In parallel, c2hs could be fixed so it doesn't do that.

Change History

Changed 3 years ago by simonmar

  • owner set to simonmar
  • milestone set to 6.12.1

Changed 3 years ago by simonmar

  • owner changed from simonmar to igloo
  • type changed from bug to merge

Fixed:

Thu Dec 10 12:45:37 GMT 2009  Simon Marlow <marlowsd@gmail.com>
  * Allow spaces at either end of the C import spec (#3742)

Changed 3 years ago by igloo

  • milestone changed from 6.12.1 to 6.12.2

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged.

Note: See TracTickets for help on using tickets.