Very clever compiling error with mangling

mesni mensikovk817 at gmail.com
Sat Jun 4 20:09:45 UTC 2022


There is no such error in DMD, but ldc has one:
```
source\api.d(6,5): Error: Function type does not match previously 
declared function with the same mangled name: 
`_D3api8testFuncFiiZi`
source\api.d(6,5):        Previous IR type: void ()
source\api.d(6,5):        New IR type:      i32 (i32, i32)
```
I have a .di with declarations, and a separate module that 
generates stub functions and global pointers from them:

```d
__gshared extern(C) static void* dpford_funcp_DMANGLE;
pragma(mangle, "DMANGLE")
void dpford_func_DMANGLE() {
	asm{
		naked;
		jmp dpford_funcp_DMANGLE;
	}
}
```

I VERY and VERY DO NOT WANT to generate a function body with the 
help of traits. I tried with ldc.attributes.naked but the same 
thing happens.


More information about the digitalmars-d-ldc mailing list