7122936
--- a/compiler/GHC/HsToCore/Foreign/Decl.hs
7122936
+++ b/compiler/GHC/HsToCore/Foreign/Decl.hs
7122936
@@ -560,7 +560,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
7122936
      ,   ppUnless res_hty_is_unit $
7122936
          if libffi
7122936
                   then char '*' <> parens (ffi_cResType <> char '*') <>
7122936
-                       text "resp = cret;"
7122936
+                       text "resp = " <> parens ffi_cResType <> text "cret;"
7122936
                   else text "return cret;"
7122936
      , rbrace
7122936
      ]