Bug 20923 – Redefinition of 'size_t' is affecting TypeStruct functions
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-06-12T00:50:27Z
Last change time
2020-06-12T08:37:56Z
Keywords
pull
Assigned to
No Owner
Creator
feklushkin.denis
Comments
Comment #0 by feklushkin.denis — 2020-06-12T00:50:27Z
Code:
================
module app;
alias c_ulong = ulong;
extern(C)
{
alias size_t = c_ulong;
struct S
{
real not_reproduceable_without_this_variable;
}
}
================
Try to compile:
$ dmd -c -m32 app.d
Error: cannot implicitly convert expression h of type ulong to uint
Error message isn't contains filename and line number, but contains reference to unknown h expression.
Comment #1 by boris2.9 — 2020-06-12T03:58:11Z
The redefinition of size_t is affecting builtin TypeStruct functions (these don't have location info), this is clearly a bug.
The code should work and you can change size_t but if you are intended to do it for this kind of methods you should be modifying object.d.
Comment #2 by dlang-bot — 2020-06-12T04:02:28Z
@BorisCarvajal created dlang/dmd pull request #11264 "Fix Issue 20923 - Redefinition of 'size_t' is affecting TypeStruct fu…" fixing this issue:
- Fix Issue 20923 - Redefinition of 'size_t' is affecting TypeStruct functions
https://github.com/dlang/dmd/pull/11264
Comment #3 by dlang-bot — 2020-06-12T08:37:56Z
dlang/dmd pull request #11264 "Fix Issue 20923 - Redefinition of 'size_t' is affecting TypeStruct fu…" was merged into stable:
- 70a3fd5ccac1c2d45c074f2712d5fc0b85386839 by Boris Carvajal:
Fix Issue 20923 - Redefinition of 'size_t' is affecting TypeStruct functions
https://github.com/dlang/dmd/pull/11264