Submitting a patch for hsc2hs

Erik de Castro Lopo mle+hs at mega-nerd.com
Fri Nov 4 09:57:26 UTC 2016


HI all,

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

Erik

>From 446e43994e39c763e2fcc3a3accea3e61c3ce767 Mon Sep 17 00:00:00 2001
From: Erik de Castro Lopo <erikd at mega-nerd.com>
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++
-- 
2.10.1



-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the ghc-devs mailing list