--- Comment #3 from manu at gcc dot gnu dot org 2010-02-24 10:23 ---
(In reply to comment #2)
> It would be nice to have the warning in the second case too, i.e. for
> (unsigned long long)(val1*val2).
Actually, it is a bit weird that the operands are not promoted to unsigned long
long.
--- Comment #2 from etienne_lorrain at yahoo dot fr 2010-02-24 09:45
---
It would be nice to have the warning in the second case too, i.e. for
(unsigned long long)(val1*val2).
Another solution, probably a lot more complex to implement, is to have
a compilation switch to expand all calcu
--- Comment #1 from manu at gcc dot gnu dot org 2010-02-24 00:16 ---
Confirmed. I am not sure if this fits Wconversion but it is something subtle
that would be nice to detect.
The testcase should be:
#include
unsigned val1 = 0x1000, val2 = 0x100;
int main(int argc, char **argv)
{