Function overloading with non-D linkage?
Marcio Faustino
m.faustino.remove at gmail.com
Fri Jan 12 10:04:16 PST 2007
Shouldn't be impossible to overload functions defined with non-D linkage?
(From http://www.digitalmars.com/d/function.html#overloading: «Functions
defined with non-D linkage cannot be overloaded.»)
For example:
/******************************************************************************/
extern (C) int print(char c) {
return printf("%c", c);
}
extern (C) int print(char* s) {
return printf("%s", s);
}
void main() {
print(cast(char*) "test\n\0");
}
/******************************************************************************/
The compiler accepts that ("dmd -c test.d") even though there will be errors
when linking.
More information about the Digitalmars-d-bugs
mailing list