scc

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

commit ff8fbe664ec6a6e003fded9c3917ebd790f57383
parent 5715cdfe3cf55369293936b1aaa10554f32eb40b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 11 Jan 2023 11:32:11 +0100

cc1: Use unsigned numbers in sizeofnode()

If we want to be 100% compliant we should use the same field
in the union that is used later to print the value. It is
not really very important in this case because it is only
a question of the signess of the value.

Diffstat:
Msrc/cmd/cc/cc1/code.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cmd/cc/cc1/code.c b/src/cmd/cc/cc1/code.c @@ -576,7 +576,7 @@ sizeofnode(Type *tp) sym = newsym(NS_IDEN, NULL); sym->type = sizettype; - sym->u.i = tp->size; - DBG("EXPR sizeof %llu", sym->u.i); + sym->u.u = tp->size; + DBG("EXPR sizeof %llu", sym->u.u); return constnode(sym); }