From d9a37b62b35cb0e44bc044d0af1cae4e50ab942a Mon Sep 17 00:00:00 2001 From: ccremers Date: Tue, 8 Aug 2006 12:35:43 +0000 Subject: [PATCH] - Some warnings are only interesting when checking. --- src/compiler.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/compiler.c b/src/compiler.c index 6df28a6..208c8ca 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -298,12 +298,15 @@ defineUsertype (Tac tcdu) /* oi!, there's already one. Let's hope is is a type too. */ if (inTermlist (tfind->stype, TERM_Type)) { - /* phew. warn anyway */ - globalError++; - eprintf ("warning: double declaration of usertype "); - termPrint (tfind); - eprintf ("\n"); - globalError--; + if (switches.check) + { + /* phew. warn anyway */ + globalError++; + eprintf ("warning: double declaration of usertype "); + termPrint (tfind); + eprintf ("\n"); + globalError--; + } } else { @@ -1807,16 +1810,19 @@ checkRoleVariables (const System sys, const Protocol p, const Role r) { if (!inTermlist (vars, declared->term)) { - // Warning - globalError++; - eprintf ("warning: variable "); - termPrint (declared->term); - eprintf (" was declared in role "); - termPrint (p->nameterm); - eprintf (","); - termPrint (r->nameterm); - eprintf (" but never used in a read event.\n"); - globalError--; + if (switches.check) + { + // Warning + globalError++; + eprintf ("warning: variable "); + termPrint (declared->term); + eprintf (" was declared in role "); + termPrint (p->nameterm); + eprintf (","); + termPrint (r->nameterm); + eprintf (" but never used in a read event.\n"); + globalError--; + } } declared = declared->next; }