Why does intpromote spew warnings for ~ operator?

bauss jj_1337 at live.dk
Tue Sep 14 06:03:24 UTC 2021


On Monday, 13 September 2021 at 22:27:11 UTC, Alexey wrote:
> On Monday, 13 September 2021 at 21:03:41 UTC, Guillaume Piolat 
> wrote:
>> On Sunday, 12 September 2021 at 14:14:03 UTC, Steven 
>> Schveighoffer wrote:
>
> It's also not exactly clear why:
> 1. D should be backward compatible with C, which is 50 years 
> old soon.
> 2. why exactly somebody should copy / paste (how many? 
> thousands?) many lines of code without thinking and rechecking. 
> Probably D can't be and shouldn't be compatible with C / C++ to 
> that distinct.
> 3. Is really backward comparability with C/C++ so important?

1. It's fairly clear why. Because a lot of the D ecosystem 
depends on C such as libraries etc. a lot of C code is/will be 
ported to D and it's impossible to do so if there are 
unclear/major behavior differences. D promotes itself with 
"betterC" which means it needs to behave like C to be a better C.

2. It's not necessarily copy-pasting but when you port code you 
don't go through it line-for-line and verify because that will 
take a very long time. There are even tools for D that allows 
porting C to D code and when using those tools you will not be 
able to verify the code that easy. Since a lot of the ecosystem 
depends on those tools then the behavior should be consistent 
with C.

3. Yes, see the first point about the ecosystem heavily relying 
on C.


More information about the Digitalmars-d mailing list