Skip to content
  • Simon Marlow's avatar
    add -fwarn-dodgy-foreign-imports (see #1357) · 3b6382e4
    Simon Marlow authored
    From the entry in the User's guide:
    
    -fwarn-dodgy-foreign-imports causes a warning to be emitted for
    foreign imports of the following form:
    
    foreign import "f" f :: FunPtr t
    
    on the grounds that it probably should be
    
    foreign import "&f" f :: FunPtr t
    
    The first form declares that `f` is a (pure) C function that takes no
    arguments and returns a pointer to a C function with type `t`, whereas
    the second form declares that `f` itself is a C function with type
    `t`.  The first declaration is usually a mistake, and one that is hard
    to debug because it results in a crash, hence this warning.
    3b6382e4