-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Occurs compilation error in overload with extern(Windows) #3362
Comments
|
Try compiling this code and look at compiler output: extern (Windows) {
void func1(ptrdiff_t);
pragma(msg, func1.mangleof);
void func2(void*);
pragma(msg, func2.mangleof);
}Outputs: In other words: the function arguments are not part of the function name in the executable (C-style mangling). This means that the executable does not distinguish between calls to your |
I think so too. Is this omission of the dlang specification? |
|
Ideally, this would be a frontend error, clearly stating that there's no such thing as overloads for C functions. But because people tend to re-declare external C[++] structs in different modules/libraries, the current DMD behavior is sadly expected, see #2782. |
|
I looked at the behavior of dmd, I think it is bug (of spec or compiler). I'll report to dmd. |
|
I reported it: https://issues.dlang.org/show_bug.cgi?id=20672 |
dmd 2.091.0 passes this code, but ldc 1.20.1 occurs an compilation error:
func1is included in another object file, Can be linked and run with dmd.I don't know which is correct, dmd or ldc. Should this be an incorrect code?
I found this problem while compiling dwt. This code:
dwt can be used without any problems with dmd.
The text was updated successfully, but these errors were encountered: