[Issue 14176] the code has a link problem.

2017-06-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

Vladimir Panteleev  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dlang-bugzilla@thecybershad
   ||ow.net
 Resolution|--- |INVALID

--- Comment #6 from Vladimir Panteleev  ---
Closing as per Kenji's explanation.

--


[Issue 14176] the code has a link problem.

2015-02-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

--- Comment #3 from Kenji Hara k.hara...@gmail.com ---
(In reply to steven kladitis from comment #0)
 import std.stdio;
 import std.traits;
 
 int foo(int x, long y);
 
 void Bar(R, P...)(R function(P))
 {
 writeln(return type is , typeid(R));
 writeln(parameter types are , typeid(P));
 }
 
 void main()
 {
 Bar(foo);
 }
 
 
 // compiles but does not link in windows

A function pointer foo should point actual function body code. But foo does
not have body. Therefore it fails to link.

Supplying body code to foo will fix the issue.

int foo(int x, long y) { return 0; }

--


[Issue 14176] the code has a link problem.

2015-02-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

--- Comment #4 from Kenji Hara k.hara...@gmail.com ---
(In reply to steven kladitis from comment #1)
 the code came the tuple page on this web site.

Note that, D supports separate compilation model. `int foo(int x, int y);` is a
function declaration without its definition (== function body code), similar
to:

// A C lib function declaration
extern(C) int printf(const char* fmt, ...);

So it's not a mistake in the example code is.

--


[Issue 14176] the code has a link problem.

2015-02-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

--- Comment #5 from steven kladitis steven_kladi...@yahoo.com ---
Thanks, I am trying to learn D. :) 
Trying examples to see what they do.

--


[Issue 14176] the code has a link problem.

2015-02-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

--- Comment #1 from steven kladitis steven_kladi...@yahoo.com ---
the code came the tuple page on this web site.

--


[Issue 14176] the code has a link problem.

2015-02-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14176

--- Comment #2 from steven kladitis steven_kladi...@yahoo.com ---
this is using dmd 2.066.1 for windows

--