Add IGNOREDRETURN warning.

This commit is contained in:
Wilson Snyder
2019-03-10 14:57:01 -04:00
parent b1831d7e33
commit 539a773ea7
12 changed files with 141 additions and 7 deletions
+9 -5
View File
@@ -1170,11 +1170,15 @@ private:
nodep->replaceWith(outrefp);
// Insert new statements
visitp = insertBeforeStmt(nodep, beginp);
} else {
// outvscp maybe non-NULL if calling a function in a taskref,
// but if so we want to simply ignore the function result
nodep->replaceWith(beginp);
}
} else {
if (nodep->taskp()->isFunction()) {
nodep->v3warn(IGNOREDRETURN,
"Ignoring return value of non-void function (IEEE 2017 13.4.1)");
}
// outvscp maybe non-NULL if calling a function in a taskref,
// but if so we want to simply ignore the function result
nodep->replaceWith(beginp);
}
// Cleanup
nodep->deleteTree(); VL_DANGLING(nodep);
UINFO(4," FTask REF Done.\n");