diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-06-19 23:50:33 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-06-19 23:50:33 +0200 |
commit | 63191949b911658c3774e727061fcf166ad9ace2 (patch) | |
tree | 4457246e240e6d4b82a7fbbee0aef1374c519bfe /sys/src/cmd/6c | |
parent | 159f96c534563f26edeeb227cd00f1bdd3bd2596 (diff) |
cc: remove nullwarn() from OCAST codegen, zap void casts
implicit casts would cause spurious "result of operation not used"
warnings such as ape's stdio putc() macro.
make (void) casts non-ops when the casted expression has no
side effects. this avoid spurious warning with ape's assert()
macro.
Diffstat (limited to 'sys/src/cmd/6c')
-rw-r--r-- | sys/src/cmd/6c/cgen.c | 5 | ||||
-rw-r--r-- | sys/src/cmd/6c/sgen.c | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sys/src/cmd/6c/cgen.c b/sys/src/cmd/6c/cgen.c index b2d54d577..3a5de9e21 100644 --- a/sys/src/cmd/6c/cgen.c +++ b/sys/src/cmd/6c/cgen.c @@ -976,10 +976,7 @@ cgen(Node *n, Node *nn) case OCAST: if(nn == Z) { - if(n->type != types[TVOID]) - nullwarn(l, Z); - else - cgen(l, Z); + cgen(l, Z); break; } /* diff --git a/sys/src/cmd/6c/sgen.c b/sys/src/cmd/6c/sgen.c index 936559bea..284c476d0 100644 --- a/sys/src/cmd/6c/sgen.c +++ b/sys/src/cmd/6c/sgen.c @@ -326,7 +326,7 @@ brk: break; case OCAST: - if(l->type->etype == TUVLONG && typefd[n->type->etype]) + if(l != Z && l->type->etype == TUVLONG && typefd[n->type->etype]) n->complex += 2; break; |