scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 66b39b58b8cda3e3c3a86c23401cad0e670a3432
parent b02b5fd160095f12c706e8b731bcc1feb6855d58
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  1 Jul 2022 18:39:03 +0200

as: Initialize nvar variable

Non initialized variables in awk have the empty string value,
that when it is used in a numerical context is evaluated to 0,
but it is still evaluated to "" in the context of an array
index. Nvar was used later to run over the arrays but 0
didn't have any content in the arrays because nvar evaluated
to "" in the first iteration.

Diffstat:
Msrc/cmd/as/mktbl.awk | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/cmd/as/mktbl.awk b/src/cmd/as/mktbl.awk @@ -1,5 +1,6 @@ BEGIN { + nvar=0 printf "#include <scc/scc.h>\n"\ "#include \"../../as.h\"\n"\ "#include \"../" family "/proc.h\"\n"