]> andersk Git - splint.git/blobdiff - src/exprNode.c
Added support for omitted if clauses in conditionals, patch provided by peteran.
[splint.git] / src / exprNode.c
index 9ddccbee6ad38af9ed8181316dcdef88a62b2445..d62c9669c65f0f3ddaa092f38f97d775eebe2beb 100644 (file)
@@ -6472,6 +6472,26 @@ exprNode_cond (/*@keep@*/ exprNode pred, /*@keep@*/ exprNode ifclause,
   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)
 {
This page took 0.046928 seconds and 4 git commands to generate.