Ticket #2100: ghc-decl-proto.patch

File ghc-decl-proto.patch, 1.1 KB (added by pcc, 6 years ago)

fixes incomplete prototype bug

  • compiler/deSugar/DsForeign.lhs

    diff -ur ghc-6.9.20080214.orig/compiler/deSugar/DsForeign.lhs ghc-6.9.20080214/compiler/deSugar/DsForeign.lhs
    old new  
    483483 
    484484  header_bits = ptext SLIT("extern") <+> fun_proto <> semi 
    485485 
     486  fun_args 
     487    | null aug_arg_info = text "void" 
     488    | otherwise         = hsep (punctuate comma (map (\(nm,ty,_,_) -> ty <+> nm)  
     489                                                     aug_arg_info)) 
     490 
    486491  fun_proto 
    487492    | libffi 
    488493      = ptext SLIT("void") <+> ftext c_nm <>  
    489494          parens (ptext SLIT("void *cif STG_UNUSED, void* resp, void** args, void* the_stableptr")) 
    490495    | otherwise 
    491       = cResType <+> pprCconv <+> ftext c_nm <> 
    492               parens (hsep (punctuate comma (map (\(nm,ty,_,_) -> ty <+> nm)  
    493                                                  aug_arg_info))) 
     496      = cResType <+> pprCconv <+> ftext c_nm <> parens fun_args 
    494497 
    495498  -- the target which will form the root of what we ask rts_evalIO to run 
    496499  the_cfun