cc: fix result of operation not used warning for void casts

This commit is contained in:
spew 2018-05-24 19:31:55 -04:00
parent 434fc6a1c4
commit 1ddf581f8c
8 changed files with 32 additions and 8 deletions

View file

@ -376,7 +376,10 @@ cgen(Node *n, int result, Node *nn)
case OCAST:
if(result == D_NONE) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, D_NONE, Z);
break;
}
lg = result;

View file

@ -376,7 +376,10 @@ cgen(Node *n, int result, Node *nn)
case OCAST:
if(result == D_NONE) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, D_NONE, Z);
break;
}
lg = result;

View file

@ -399,7 +399,10 @@ cgenrel(Node *n, Node *nn, int inrel)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*

View file

@ -976,7 +976,10 @@ cgen(Node *n, Node *nn)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*

View file

@ -994,7 +994,10 @@ cgen(Node *n, Node *nn)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*

View file

@ -358,7 +358,10 @@ cgen(Node *n, Node *nn)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*

View file

@ -395,7 +395,10 @@ cgen(Node *n, Node *nn)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*

View file

@ -359,7 +359,10 @@ cgen(Node *n, Node *nn)
case OCAST:
if(nn == Z) {
nullwarn(l, Z);
if(n->type != types[TVOID])
nullwarn(l, Z);
else
cgen(l, Z);
break;
}
/*