After migrating to Swift 2, I am getting this issue with an error stating that I should now use @convention(c) (T) -> U. I\'ve tried permutations but so far no luck.
You no longer need to create a CFunctionPointer in Swift 2. Instead, you can annotate your type by calling convention, in this case c, and use it directly.
typealias CFunction = @convention(c) (UnsafeMutablePointer, Float) -> Int
let bar = unsafeBitCast(foo, CFunction.self)
The relevant bits of the @convention description in the Type Attributes section of The Swift Programming Language are:
The c argument is used to indicate a C function reference. The function value carries no context and uses the C calling convention.