diff options
author | Araq <rumpf_a@web.de> | 2017-05-16 22:09:37 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-05-16 22:09:37 +0200 |
commit | 943aaecbe751f76b53f1a8332b2bee1fa3a00fb2 (patch) | |
tree | cddf93c9aa8f420fe04c7310d93817eae75ac96f /compiler | |
parent | ac3e7edfe43a6353da286fa9606319efaf8d60d3 (diff) | |
parent | 6599cae2810148d0a36d9c2d9be964d73c514559 (diff) | |
download | Nim-943aaecbe751f76b53f1a8332b2bee1fa3a00fb2.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cgen.nim | 8 | ||||
-rw-r--r-- | compiler/semstmts.nim | 3 |
2 files changed, 7 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" & diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 3d70e7295..be0d90c0f 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -982,6 +982,9 @@ proc semProcAnnotation(c: PContext, prc: PNode; var x = newNodeI(nkCall, n.info) x.add(newSymNode(m)) prc.sons[pragmasPos] = copyExcept(n, i) + if prc[pragmasPos].kind != nkEmpty and prc[pragmasPos].len == 0: + prc.sons[pragmasPos] = emptyNode + if it.kind == nkExprColonExpr: # pass pragma argument to the macro too: x.add(it.sons[1]) |