}
e->guards = guardSet_new ();
+
e->sets = sRefSet_new ();
e->msets = sRefSet_new ();
e->uses = sRefSet_new ();
if (opid == OR_OP)
{
+ exprNode_produceGuards (e2);
ret->guards = guardSet_or (ret->guards, e2->guards);
}
else if (opid == AND_OP)
{
+ exprNode_produceGuards (e2); /* evans 2003-08-13: need to produce guards for expression */
+ /* Shouldn't this have already happened? */
+ DPRINTF (("Anding guards: %s / %s", guardSet_unparse (ret->guards), guardSet_unparse (e2->guards)));
ret->guards = guardSet_and (ret->guards, e2->guards);
}
else
}
else
{
- voptgenerror
- (FLG_REALCOMPARE,
- message ("Dangerous comparison involving %s types: %s",
- ctype_unparse (rtype),
- exprNode_unparse (ret)),
- ret->loc);
+ if (opid == EQ_OP || opid == NE_OP)
+ {
+ voptgenerror
+ (FLG_REALCOMPARE,
+ message ("Dangerous equality comparison involving %s types: %s",
+ ctype_unparse (rtype),
+ exprNode_unparse (ret)),
+ ret->loc);
+ }
+ else
+ {
+ voptgenerror
+ (FLG_REALRELATECOMPARE,
+ message ("Possibly dangerous relational comparison involving %s types: %s",
+ ctype_unparse (rtype),
+ exprNode_unparse (ret)),
+ ret->loc);
+ }
}
}
/*@fallthrough@*/
return (ret);
}
+exprNode
+exprNode_condIfOmit (/*@keep@*/ exprNode pred,
+ /*@keep@*/ exprNode elseclause)
+{
+ exprNode ifclause = exprNode_createPartialCopy (pred);
+
+ if (!context_flagOn (FLG_GNUEXTENSIONS, exprNode_loc (pred)))
+ {
+ (void) llgenhinterror
+ (FLG_SYNTAX,
+ message ("Conditionals with Omitted Operands is not supported by ISO C99"),
+ message ("Use +gnuextensions to allow compound statement "
+ "expressions (and other GNU language extensions) "
+ "without this warning"),
+ exprNode_loc (pred));
+ }
+
+ return exprNode_cond(pred, ifclause, elseclause);
+}
+
exprNode
exprNode_vaArg (/*@only@*/ lltok tok, /*@only@*/ exprNode arg, /*@only@*/ qtype qt)
{