diff --git a/doc/manual.txt b/doc/manual.txt index 29b51321e..4351d7232 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4673,9 +4673,10 @@ A proc can be marked with the `noStackFrame`:idx: pragma to tell the compiler it should not generate a stack frame for the proc. There are also no exit statements like ``return result;`` generated and the generated C function is declared as ``__declspec(naked)`` or ``__attribute__((naked))`` (depending on -the used C compiler). This is useful for procs that only consist of an -assembler statement. +the used C compiler). +**Note**: This pragma should only be used by procs which consist solely of assembler +statements. error pragma ------------ diff --git a/lib/system.nim b/lib/system.nim index 174912519..d29479184 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1791,7 +1791,7 @@ when defined(JS): elif hostOS != "standalone": {.push stack_trace:off, profiler:off.} - proc add*(x: var string, y: cstring) {.noStackFrame.} = + proc add*(x: var string, y: cstring) = var i = 0 while y[i] != '\0': add(x, y[i]) diff --git a/tests/run/temit.nim b/tests/run/temit.nim index 460bc3443..ff8df0585 100644 --- a/tests/run/temit.nim +++ b/tests/run/temit.nim @@ -9,9 +9,9 @@ static int cvariable = 420; """.} -proc embedsC() {.noStackFrame.} = +proc embedsC() = var nimrodVar = 89 - {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".} + {.emit: """printf("%d\n", cvariable + (int)`nimrodVar`);""".} embedsC()