aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-03-03 10:59:40 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-03-03 11:17:47 +0100
commit7fd3778e2d3a7b17aefea66819bf07feb7a257d3 (patch)
tree1f6585825efa0db36357dce2c710fb2aad757c5d
parent5374221b943f36cd9d18ab80a09c3d15b350a3f3 (diff)
downloadsparse-7fd3778e2d3a7b17aefea66819bf07feb7a257d3.tar.gz
expand: add explanation to 'conservative'
The variable 'conservative' is used to allow testing some characteristics of an expression while inhibiting any possible side-efects like issuing a warning or marking the expression as erroneous. But this role is not immedialtely apparent. So, add a comment to the variable declaration. Suggested-by: Thomas Weißschuh <thomas@t-8ch.de> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--expand.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/expand.c b/expand.c
index 95f9fda6..455d5bae 100644
--- a/expand.c
+++ b/expand.c
@@ -47,6 +47,11 @@
static int expand_expression(struct expression *);
static int expand_statement(struct statement *);
+
+// If set, don't issue a warning on divide-by-0, invalid shift, ...
+// and don't mark the expression as erroneous but leave it as-is.
+// This allows testing some characteristics of the expression
+// without creating any side-effects (e.g.: is_zero_constant()).
static int conservative;
static int expand_symbol_expression(struct expression *expr)