-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion error for ulong -> uint (as a size_t) on 32-bit linux #4
Comments
Maybe the code wasn't tested on a 32-bit machine? |
Thanks Martin for stopping by.
The fix may be trivial however I wanted to ask for official approach to the conversion issues from size_t real types. https://github.com/D-Programming-Language-Labs/Curiosity
Yeah, that confused me as I initially indeed checked his Phobos branch. And there is no issue tracker enabled. |
Just FYI. I played a bit with the code and after changing the problematic ulongs to size_t I had to comment out a few asserts and a couple of crashing tests. Maybe I will prepare a PR to the proper repo tomorrow or a day after. You can safely ignore this thread for some time. |
What is current policy for dealing with ulong -> size_t conversion?
dmd -main -unittest allocator.d
allocator.d(2015): Error: cannot implicitly convert expression (i * 4096LU) of type ulong to uint
allocator.d(2015): Error: cannot implicitly convert expression ((i + cast(ulong)blocks) * 4096LU) of type ulong to uint
allocator.d(1743): Error: template instance std.allocator.HeapBlock!(4096u, 4u)
allocator.d(331): instantiated from here: HeapBlock!(4096u, 4u)
allocator.d(334): Error: template instance Segregator!
allocator.d(2015): Error: cannot implicitly convert expression (i * 128LU) of type ulong to uint
allocator.d(2015): Error: cannot implicitly convert expression ((i + cast(ulong)blocks) * 128LU) of type ulong to uint
allocator.d(1743): Error: template instance std.allocator.HeapBlock!(128u, 4u)
allocator.d(1342): instantiated from here: HeapBlock!(128u, 4u)
allocator.d(1493): Error: cannot implicitly convert expression (x / 64LU) of type ulong to immutable(uint)
allocator.d(1495): Error: cannot implicitly convert expression (y / 64LU) of type ulong to immutable(uint)
allocator.d(1520): Error: cannot implicitly convert expression (x / 64LU) of type ulong to uint
allocator.d(1526): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(1527): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(1544): Error: cannot implicitly convert expression (w) of type ulong to uint
allocator.d(1553): Error: cannot implicitly convert expression (w) of type ulong to uint
allocator.d(1572): Error: cannot implicitly convert expression (w) of type ulong to uint
allocator.d(1582): Error: cannot implicitly convert expression (w) of type ulong to uint
allocator.d(1607): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(1615): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(1627): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(1633): Error: cannot implicitly convert expression (i) of type ulong to uint
allocator.d(4143): Error: function std.allocator.roundUpToMultipleOf (uint s, uint base) is not
callable using argument types (ulong, uint)
The text was updated successfully, but these errors were encountered: