{
ExprDesc Expr;
int GotBreak;
+ CodeMark Start;
/* Assume no pending token */
if (PendingToken) {
break;
default:
+ /* Remember the current code position */
+ Start = GetCodePos ();
/* Actual statement */
ExprWithCheck (hie0, &Expr);
/* Load the result only if it is an lvalue and the type is
if (ED_IsLVal (&Expr) && IsQualVolatile (Expr.Type)) {
ExprLoad (CF_NONE, &Expr);
}
+ /* If the statement didn't generate code, and is not of type
+ * void, emit a warning
+ */
+ if (GetCodePos () == Start && !IsTypeVoid (Expr.Type)) {
+ Warning ("Statement has no effect");
+ }
CheckSemi (PendingToken);
}
}