take comma expr in account for constant value
commit69e12d779f77120ed7be3b7c67c501e4aa953bd3
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 4 Aug 2017 13:34:47 +0000 (4 15:34 +0200)
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Fri, 4 Aug 2017 13:49:16 +0000 (4 15:49 +0200)
treee7b09397e1d336cac0c00c1ae99868ed985f256d
parent0c4c998690e5e31696404fa518022865fd9232d2
take comma expr in account for constant value

It's often the case that we simply need the expr's truth value.

To get the value of an expression or simply if we need to know
if it's a constant value we can use some functions like
get_expression_value() or const_expression_value() depending
on the type of warning needed if the expression is not constant
(for various definition of constant).

However none of these functions take in account the fact that
a comma expression can also have a value known at compile time.

In order to not introduce unwanted change elsewheer in the code,
introduce a new function expr_truth_value() which never warn
but will return -1 if the expr have no known boolean value.

Note: the whole set of functions should be unified to take comma
      expressions in account when needed.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
expand.c
expression.h