commit 9ef71d0377a399f0e0c8e3bcfd47843fb5d66210
parent 99a2aaeb775c3ba5d69e48b2501af71fce63e648
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 20 Feb 2026 09:23:49 +0100
cc1: Mark builltin with side effect
The vaarg builtins are used to handle variable length argument and
they do modify the va argument that they receive, so emiting warnings
for them didn't make sense.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/cmd/scc-cc/cc1/builtin.c b/src/cmd/scc-cc/cc1/builtin.c
@@ -26,6 +26,7 @@ builtin_va_arg(Symbol *sym)
np = node(OBUILTIN, tp, ap, NULL);
np->sym = sym;
+ np->flags |= NEFFECT;
return np;
error:
@@ -52,6 +53,7 @@ builtin_va_copy(Symbol *sym)
src = node(OPTR, src->type->type, src, NULL);
np = node(OASSIGN, dst->type, dst, src);
np = node(OCAST, voidtype, np, NULL);
+ np->flags |= NEFFECT;
return np;
}
@@ -86,6 +88,7 @@ builtin_va_start(Symbol *sym)
np = node(OBUILTIN, voidtype, ap, last);
np->sym = sym;
+ np->flags |= NEFFECT;
return np;
error:
@@ -107,6 +110,7 @@ builtin_va_end(Symbol *sym)
np = node(OBUILTIN, voidtype, ap, NULL);
np->sym = sym;
+ np->flags |= NEFFECT;
return np;
}