02-12-2020, 03:25 PM
We don't see why any static analyser would report 'non_compliant_and' as non-compliant. If random_bool indeed generates a random boolean value, then you can't assume that its false, so both terms may be used in b1 && b2.
The DU anomaly should only be reported when code can never be used, like false && b2;
Similarly with 'non_compliant_or'
The DU anomaly should only be reported when code can never be used, like false && b2;
Similarly with 'non_compliant_or'
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group