diff options
author | Markus F.X.J. Oberhumer <markus.oberhumer@oberhumer.com> | 2017-05-16 21:04:12 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-05-16 21:04:12 +0200 |
commit | 8d3f477fada2883ecc312f9342a9847d25fcf741 (patch) | |
tree | 76f18b8d80929fa6b678787901154ddce414cef2 | |
parent | 0613f08b2461c5ecb64518a65e20c3769938d21e (diff) | |
download | Nim-8d3f477fada2883ecc312f9342a9847d25fcf741.tar.gz |
Create correct C protoypes in genMainProc. (#5822)
This avoids a -Wstrict-prototypes warning in the generated C file.
-rw-r--r-- | compiler/cgen.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index b27d9cbce..fab35c584 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -889,14 +889,14 @@ proc genMainProc(m: BModule) = # prevents inlining of the NimMainInner function and dependent # functions, which might otherwise merge their stack frames. PreMainBody = - "void PreMainInner() {$N" & + "void PreMainInner(void) {$N" & "\tsystemInit000();$N" & "$1" & "$2" & "$3" & "}$N$N" & - "void PreMain() {$N" & - "\tvoid (*volatile inner)();$N" & + "void PreMain(void) {$N" & + "\tvoid (*volatile inner)(void);$N" & "\tsystemDatInit000();$N" & "\tinner = PreMainInner;$N" & "$4$5" & @@ -915,7 +915,7 @@ proc genMainProc(m: BModule) = NimMainProc = "N_CDECL(void, NimMain)(void) {$N" & - "\tvoid (*volatile inner)();$N" & + "\tvoid (*volatile inner)(void);$N" & "\tPreMain();$N" & "\tinner = NimMainInner;$N" & "$2" & |