Bug in ^^

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Sep 17 20:18:37 UTC 2019


On Tuesday, 17 September 2019 at 20:13:21 UTC, lithium iodate 
wrote:
> Formally, operations with unsigned integers can never overflow 
> in C and you can therefore not warn about overflow. Since the 
> warning can then only occur for signed integers (as observed), 
> any such warning directly implies undefined behavior as per the 
> C standard.

No, you're implying causation from a correlation.

In any case, compiler warnings are not governed by what's defined 
behavior or not. Compilers can and do warn about many code 
fragments which are fully defined, and the world is a better 
place for that. A warning here would be useful, so there should 
be one.



More information about the Digitalmars-d mailing list