Closed
Description
The following example produces warning with cpp target and vcc 2019:
var i = 1
let x = bool(i)
echo x
vcc 2019 warning:
a.nim(4): warning C4804: '<': unsafe use of type 'bool' in operation
a.nim(4): warning C4804: '>': unsafe use of type 'bool' in operation
Warning is produced on the following generated range check code:
if ((i) < NIM_FALSE || (i) > NIM_TRUE){ raiseRangeErrorI(i, NIM_FALSE, NIM_TRUE); }
x = ((NIM_BOOL) (i));
<
and >
comparison with true
and false
is not quite correct cpp.