How to create a function declaration?

Marcio Faustino m.faustino.remove at gmail.com
Fri Jan 12 11:36:55 PST 2007


Frits van Bommel wrote:
> 'printf' is problematic because object.d (which is automatically
> imported into every D module) also declares it.
>
> That code might otherwise compile, but I'm not sure what would happen at
> the linking stage; printf is also defined in the C runtime library which
> is linked to by default. It might just use one of the two, or it might fail.

But the problem is that the code *does not* compile with the line that says
"Error" uncommented. Without getting into linking details, the compiler *should*
accept the given definition because "object.d" and "internal/object.d" only
contain declarations of the printf function.

Am I wrong?


More information about the Digitalmars-d-learn mailing list