Add brackets to resolve ambiguity#927
Conversation
|
@thk123 - could you comment on why this hasn't caused Travis to fail? Are the unit tests built with different settings to the main build so that warnings don't cause errors? |
|
@NathanJPhillips So I looked at the travis file and as we suspected, the I think line 155 should read: That is replacing The AppVeyor.yml seems to be building consistently. |
4f321b9 to
31cba6b
Compare
… logical operators
|
OK, I've pushed a commit with Travis updated but without the fix to show that it fails. I'll then push the fix once we've seen the failure. |
|
Here is the failed build showing the problem: https://travis-ci.org/diffblue/cbmc/builds/232900282 I've now pushed the fix. |
There is an ambiguity in this expression caused by a mix of bit-wise (operator&) and logical (operator!) operators in mini_bdd.
Personally I would change the bit-wise operators to logical operators in mini_bdd but some concern was raised that people may then wrongly expect them to short-circuit, as the Boolean logical operators do. (Overridden logical operators do not short-circuit, as stated here under Restrictions: http://en.cppreference.com/w/cpp/language/operators.)
The other option would be to change the operator! to operator~, but in my opinion this would be moving in the wrong direction and reduce code-clarity.