# $ cat test.nim
proc test() {.cdecl.}
proc test() {.cdecl.} =
echo 0
stefan@AMD64X2 ~/nim-app $ nim c test.nim [...] test.nim(3, 13) Error: pragmas are only allowed in the header of a proc stefan@AMD64X2 ~/nim-app $ nim -v Nim Compiler Version 0.11.3 (2015-08-11) [Linux: amd64]
No idea currently, Removing the {.cdecl.} from the forward declaration does not help. I have the feeling that {.cdecl.} does not work whenever there exists a forward declaration.