From 63191949b911658c3774e727061fcf166ad9ace2 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 19 Jun 2019 23:50:33 +0200 Subject: 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. --- sys/src/cmd/cc/com.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/src/cmd/cc') diff --git a/sys/src/cmd/cc/com.c b/sys/src/cmd/cc/com.c index 9fcf9861f..46a59d49a 100644 --- a/sys/src/cmd/cc/com.c +++ b/sys/src/cmd/cc/com.c @@ -1073,6 +1073,11 @@ loop: break; case OCAST: + if(n->type == types[TVOID] && !side(l)){ + n->left = Z; + n->type = T; + break; + } if(castucom(n)) warn(n, "32-bit unsigned complement zero-extended to 64 bits"); ccom(l); -- cgit v1.2.3