[Issue 24029] New: ImportC: symbol name clash on statement expressions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 3 19:39:30 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24029
Issue ID: 24029
Summary: ImportC: symbol name clash on statement expressions
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
Found in the test case of https://github.com/dlang/dmd/pull/15375 with multiple
asserts. Reduced:
```C
int x = 0;
int y = 0;
void a()
{
(__extension__ ({ x += 2; })); // test.a.__dgliteral1
}
void b()
{
(__extension__ ({ y += 1; })); // test.b.__dgliteral1
}
int main(void)
{
a();
b();
__check(x == 2);
__check(y == 1);
return 0;
}
```
Output:
```
/usr/bin/ld: warning: size of symbol `__dgliteral1' changed from 20 in test.o
to 19 in test.o
```
And the test fails. Because it's ImportC, the __dgliteral symbols don't get
their function as a prefix in the mangle, so the symbols clash.
--
More information about the Digitalmars-d-bugs
mailing list