From 4ed757bae92c8132d4b6c8e07115b28999763c76 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 16 Feb 2008 14:10:31 +0000 Subject: [PATCH] Generate foo(void) rather than foo() in FFI stub files -Wstrict-prototypes warns about the latter. Patch from pcc in trac #2100. --- compiler/deSugar/DsForeign.lhs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs index 05ff8bd..9ad1d48 100644 --- a/compiler/deSugar/DsForeign.lhs +++ b/compiler/deSugar/DsForeign.lhs @@ -483,14 +483,17 @@ mkFExportCBits c_nm maybe_target arg_htys res_hty is_IO_res_ty cc header_bits = ptext SLIT("extern") <+> fun_proto <> semi + fun_args + | null aug_arg_info = text "void" + | otherwise = hsep $ punctuate comma + $ map (\(nm,ty,_,_) -> ty <+> nm) aug_arg_info + fun_proto | libffi = ptext SLIT("void") <+> ftext c_nm <> parens (ptext SLIT("void *cif STG_UNUSED, void* resp, void** args, void* the_stableptr")) | otherwise - = cResType <+> pprCconv <+> ftext c_nm <> - parens (hsep (punctuate comma (map (\(nm,ty,_,_) -> ty <+> nm) - aug_arg_info))) + = cResType <+> pprCconv <+> ftext c_nm <> parens fun_args -- the target which will form the root of what we ask rts_evalIO to run the_cfun -- 1.7.10.4