D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18307 - -transition=intpromote deprecation message confusing
Summary: -transition=intpromote deprecation message confusing
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-26 21:40 UTC by Timothee Cour
Modified: 2024-12-13 18:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Timothee Cour 2018-01-26 21:40:49 UTC
see https://github.com/msgpack/msgpack-d/pull/99/files/728edb1d58c8e027adf5740e3fbcf425639710c4#r164228277 for context.

dmd.2_078_1/.dub/packages/msgpack-d-1.0.0-beta.6/msgpack-d/src/msgpack/unpacker.d(199,30): Deprecation: integral promotion not done for -header, use '-transition=intpromote' switch or -cast(int)(header)

* should that be -int(header) instead of -cast(int)(header) ?
* could dmd also report the type of `header` since it already knows about it?
Comment 1 Zach the Mystic 2018-04-15 02:48:20 UTC
I tested it and this works:

// change this:
// value = -(cast(T)-header);

// to this:
value = cast(T)cast(byte)header;

header is a ubyte. When changed to a byte, in this context, it becomes negative. The compiler then creates a corresponding negative int.
Comment 2 Zach the Mystic 2018-04-15 02:50:14 UTC
...or whatever negative Integral type it requires. (I did only test it with `int`, but I think it should work regardless.
Comment 3 dlangBugzillaToGithub 2024-12-13 18:56:22 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17834

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB