September 26, 2022 [Issue 23378] New: ImportC: dynamic array alias imported by C treated as pointer when used as function parameter. | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23378 Issue ID: 23378 Summary: ImportC: dynamic array alias imported by C treated as pointer when used as function parameter. Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: ImportC Severity: minor Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: dave287091@gmail.com 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)* } -- |
Copyright © 1999-2021 by the D Language Foundation