** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
** MA 02111-1307, USA.
**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
** For more information: http://www.splint.org
*/
/*
** exprChecks.c
*/
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
# include "basic.h"
# include "cgrammar.h"
# include "cgrammar_tokens.h"
**
*/
+static int inCompoundStatementExpression = 0;
+
+void
+exprChecks_inCompoundStatementExpression (void)
+{
+ inCompoundStatementExpression++;
+}
+
+void
+exprChecks_leaveCompoundStatementExpression (void)
+{
+ inCompoundStatementExpression--;
+ llassert (inCompoundStatementExpression >= 0);
+}
+
void
-exprNode_checkStatement (exprNode e)
+exprChecks_checkStatementEffect (exprNode e)
{
bool hasError = FALSE;
+ if (inCompoundStatementExpression > 0)
+ {
+ /*
+ ** Okay to have effectless statments in compound statement expression (should check
+ ** it is the last statement, but we don't for now).
+ */
+
+ return;
+ }
+
if (!exprNode_isError (e))
{
exprKind ek = e->kind;
/*drl modified */
-void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode fcnBody)
+void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode body)
{
constraintList c, t, post;
constraintList c2, fix;
constraintList implicitFcnConstraints;
-
- /*@owned@*/ exprNode body;
-
context_enterInnerContext ();
- body = fcnBody;
+ llassert (exprNode_isDefined (body));
/*
if we're not going to be printing any errors for buffer overflows
}
}
- exprNode_generateConstraints (body);
+ exprNode_generateConstraints (body); /* evans 2002-03-02: this should not be declared to take a
+ dependent... fix it! */
c = uentry_getFcnPreconditions (ue);
DPRINTF(("function constraints\n"));