Why does intpromote spew warnings for ~ operator?
Guillaume Piolat
first.last at gmail.com
Mon Sep 13 21:03:41 UTC 2021
On Sunday, 12 September 2021 at 14:14:03 UTC, Steven
Schveighoffer wrote:
> With the -preview=intpromote switch, the uncasted negation
> compiles and runs as expected.
>
> Right now, the deprecation is telling users under penalty of
> not compiling to do something that will achieve nothing when
> intpromote is enabled.
What is achieve is that people can review the place where -x and
~x were used, and see if there was bug there ; because it is a
real possibility that C code was ported and then it has a
different semantics.
The end game of it is:
A. "when you paste C code and it builds then it's the same"
instead of:
B. "when you paste C code and it builds then it's the same,
EXCEPT -x and ~x who don't promote their operand to int"
when people of the future come to D in 2030 they will enjoy the
proposition A instead of B.
More information about the Digitalmars-d
mailing list