Bug 23378 – ImportC: dynamic array alias imported by C treated as pointer when used as function parameter.

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-26T21:02:16Z
Last change time
2024-12-13T19:24:50Z
Keywords
ImportC
Assigned to
No Owner
Creator
dave287091
Moved to GitHub: dmd#20159 →

Comments

Comment #0 by dave287091 — 2022-09-26T21:02:16Z
Below is for a 64bit target: // s.d alias String = const(char)[]; // x.c __import s; _Static_assert(sizeof(String) == 16, ""); String bar; _Static_assert(sizeof(bar) == 16, ""); void foo(String a){ _Static_assert(sizeof(a) == 16, ""); // this fails const char* b = a; // this compiles, which implies the arg is just a const(char)* }
Comment #1 by robert.schadek — 2024-12-13T19:24:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20159 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB