Annoyance with new integer promotion deprecations
Manu
turkeyman at gmail.com
Sun Feb 18 21:14:09 UTC 2018
On 18 February 2018 at 12:01, Jonathan M Davis via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:
> On Sunday, February 18, 2018 19:42:07 Johan Engelen via Digitalmars-d
> wrote:
> > > There are hundreds of lines I need to molest to make the
> > > compiler shut up. I won't type another line of code on my
> > > colour library until this noise is gone... I will not maintain
> > > it. I am emotionally incapable of assaulting my code with those
> > > casts.
> >
> > Using the `-transition=intpromote` compile flag is no option for
> > you?
>
> Since that's a transition flag, it's really only a stop-gap solution. So,
> if
> his issue is that he doesn't like having the casts in his code as opposed
> to
> not wanting to deal with updating his code right now, the flag really
> doesn't help.
>
> I'd say that if he's not going to abandon his library, he either needs to
> just grit his teeth and use the explicit casts, or he's going to need to
> refactor the code so that the casts are unnecessary.
>
> - Jonathan M Davis
>
Here's one file for instance (they all do this, although I can rearrange
the noise somewhat):
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(((v ^ 512u) == 0u ? ~v : -v) & 511u)`, use
'-transition=intpromote' switch or `-cast(int)(convertNormBits(((v ^ 512u)
== 0u ? ~v : -v) & 511u))`
std\experimental\normint.d(526,119): Deprecation: integral promotion not
done for `~v`, use '-transition=intpromote' switch or `~cast(int)(v)`
std\experimental\normint.d(526,124): Deprecation: integral promotion not
done for `-v`, use '-transition=intpromote' switch or `-cast(int)(v)`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `+this.value`, use '-transition=intpromote' switch or
`+cast(int)(this.value)`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `-this.value`, use '-transition=intpromote' switch or
`-cast(int)(this.value)`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `~this.value`, use '-transition=intpromote' switch or
`~cast(int)(this.value)`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `~this.value`, use '-transition=intpromote' switch or
`~cast(int)(this.value)`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `-this.value`, use '-transition=intpromote' switch or
`-cast(int)(this.value)`
std\experimental\normint.d(526,119): Deprecation: integral promotion not
done for `~v`, use '-transition=intpromote' switch or `~cast(int)(v)`
std\experimental\normint.d(526,124): Deprecation: integral promotion not
done for `-v`, use '-transition=intpromote' switch or `-cast(int)(v)`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(cast(ubyte)(((cast(int)v ^ 128) == 0 ?
cast(int)~v : cast(int)-v) & 127))`, use '-transition=intpromote' switch or
`-cast(int)(convertNormBits(cast(ubyte)(((cast(int)v ^ 128) == 0 ?
cast(int)~v : cast(int)-v) & 127)))`
std\experimental\normint.d(526,119): Deprecation: integral promotion not
done for `~v`, use '-transition=intpromote' switch or `~cast(int)(v)`
std\experimental\normint.d(526,124): Deprecation: integral promotion not
done for `-v`, use '-transition=intpromote' switch or `-cast(int)(v)`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(cast(ushort)(((cast(int)v ^ 32768) == 0 ?
cast(int)~v : cast(int)-v) & 32767))`, use '-transition=intpromote' switch
or `-cast(int)(convertNormBits(cast(ushort)(((cast(int)v ^ 32768) == 0 ?
cast(int)~v : cast(int)-v) & 32767)))`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(((v ^ 2u) == 0u ? ~v : -v) & 1u)`, use
'-transition=intpromote' switch or `-cast(int)(convertNormBits(((v ^ 2u) ==
0u ? ~v : -v) & 1u))`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(((v ^ 4u) == 0u ? ~v : -v) & 3u)`, use
'-transition=intpromote' switch or `-cast(int)(convertNormBits(((v ^ 4u) ==
0u ? ~v : -v) & 3u))`
std\experimental\normint.d-mixin-78(78,1): Deprecation: integral promotion
not done for `+this.value`, use '-transition=intpromote' switch or
`+cast(int)(this.value)`
std\experimental\normint.d(526,119): Deprecation: integral promotion not
done for `~v`, use '-transition=intpromote' switch or `~cast(int)(v)`
std\experimental\normint.d(526,124): Deprecation: integral promotion not
done for `-v`, use '-transition=intpromote' switch or `-cast(int)(v)`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(cast(const(ubyte))(((cast(int)v ^ 128) == 0 ?
cast(int)~v : cast(int)-v) & 127))`, use '-transition=intpromote' switch or
`-cast(int)(convertNormBits(cast(const(ubyte))(((cast(int)v ^ 128) == 0 ?
cast(int)~v : cast(int)-v) & 127)))`
std\experimental\normint.d(526,119): Deprecation: integral promotion not
done for `~v`, use '-transition=intpromote' switch or `~cast(int)(v)`
std\experimental\normint.d(526,124): Deprecation: integral promotion not
done for `-v`, use '-transition=intpromote' switch or `-cast(int)(v)`
std\experimental\normint.d(526,24): Deprecation: integral promotion not
done for `-convertNormBits(cast(const(ushort))(((cast(int)v ^ 32768) == 0 ?
cast(int)~v : cast(int)-v) & 32767))`, use '-transition=intpromote' switch
or `-cast(int)(convertNormBits(cast(const(ushort))(((cast(int)v ^ 32768) ==
0 ? cast(int)~v : cast(int)-v) & 32767)))`
I'll admit I'm wildly overreacting, but I don't want to explicitly write
the implicit casts.
It's a library for other people to use; so the suggestion is really "tell
everyone using the lib to build with -transition=intpromote".
If -x does implicit int promotion, fine... but I don't want to explicitly
cast to int everywhere to silence the noise up when the cast is actually
implicit!
How long is this message meant to hang around? I think I'd rather wait
until it's gone than change the code...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20180218/cafd7436/attachment.html>
More information about the Digitalmars-d
mailing list