digitalmars.D - alias symbols in object files
- John Colvin (13/13) Apr 21 2013 test.d:
- John Colvin (3/16) Apr 21 2013 Just to avoid any confusion for non-linux guys:
- Andrej Mitrovic (3/5) Apr 21 2013 Aliases are a purely compile-time feature. Wherever they're used it's
- Peter Alexander (3/5) Apr 21 2013 What would you expect it to look like in the object file? A
- John Colvin (5/10) Apr 21 2013 Something like that, yes.
test.d:
extern (C):
void foo(){}
alias foo bar;
$dmd -c test.d
$nm test.o
0000000000000000 t
0000000000000000 D _D11test12__ModuleInfoZ
w _d_dso_registry
U _Dmodule_ref
0000000000000000 T foo
Surely the aliased symbol should appear in the object file, or am
I missing something?
Apr 21 2013
On Sunday, 21 April 2013 at 18:54:27 UTC, John Colvin wrote:
test.d:
extern (C):
void foo(){}
alias foo bar;
$dmd -c test.d
$nm test.o
0000000000000000 t
0000000000000000 D _D11test12__ModuleInfoZ
w _d_dso_registry
U _Dmodule_ref
0000000000000000 T foo
Surely the aliased symbol should appear in the object file, or
am I missing something?
Just to avoid any confusion for non-linux guys:
nm is a linux utility for listing the symbols in an object file.
Apr 21 2013
On 4/21/13, John Colvin <john.loughran.colvin gmail.com> wrote:Surely the aliased symbol should appear in the object file, or am I missing something?Aliases are a purely compile-time feature. Wherever they're used it's as if the compiler rewrote the alias with the aliased symbol.
Apr 21 2013
On Sunday, 21 April 2013 at 18:54:27 UTC, John Colvin wrote:Surely the aliased symbol should appear in the object file, or am I missing something?What would you expect it to look like in the object file? A duplicate of the foo function?
Apr 21 2013
On Sunday, 21 April 2013 at 19:22:27 UTC, Peter Alexander wrote:On Sunday, 21 April 2013 at 18:54:27 UTC, John Colvin wrote:Something like that, yes. I have a templated function and need particular instantiations of it in a library. If aliases cannot be used for this, I suppose the most reasonable option is to write wrapper functions.Surely the aliased symbol should appear in the object file, or am I missing something?What would you expect it to look like in the object file? A duplicate of the foo function?
Apr 21 2013









"John Colvin" <john.loughran.colvin gmail.com> 