Submitting a patch for hsc2hs

Erik de Castro Lopo mle+hs at
Fri Nov 4 09:57:26 UTC 2016

HI all,

How would I go about submitting a patch to hsc2hs? Patch below.


>From 446e43994e39c763e2fcc3a3accea3e61c3ce767 Mon Sep 17 00:00:00 2001
From: Erik de Castro Lopo <erikd at>
Date: Fri, 4 Nov 2016 20:08:06 +1100
Subject: [PATCH] Fix type signature of main test function

During C compiler feature testing, the `main` function was defined
with a parameter list of `(int argc, char *argv [])` but these
parameters were not used. This results in compiler warnings when
the generated file is compiled with the `-Wextra` warning flag
added to the `cc-options` of the cabal file.
 DirectCodegen.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DirectCodegen.hs b/DirectCodegen.hs
index 37564ee..2a88784 100644
--- a/DirectCodegen.hs
+++ b/DirectCodegen.hs
@@ -63,7 +63,7 @@ outputDirect config outName outDir outBase name toks = do
         outTemplateHeaderCProg (cTemplate config)++
         concatMap outFlagHeaderCProg flags++
         concatMap outHeaderCProg specials++
-        "\nint main (int argc, char *argv [])\n{\n"++
+        "\nint main (void)\n{\n"++
         outHeaderHs flags (if needsH then Just outHName else Nothing) specials++
         outHsLine (SourcePos name 0)++
         concatMap outTokenHs toks++

Erik de Castro Lopo

More information about the ghc-devs mailing list