By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,486 Members | 1,694 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,486 IT Pros & Developers. It's quick & easy.

use of weak_alias or strong_alias in application code?

P: n/a
I want to use alias to call a defined function (special_subroutine in
this example) using different names (special_subroutine_1 and
special_subroutine_2 in this example), is it doable? --I tried the
following way, and it did not work when I tried to compile it with
gcc. I guess weak_alias is only valid for glibc, or maybe the way I use
it was wrong.

Can someone give me a suggestion?

-------------------------------------------------------
//file name: test.c
//date: 07/09/2006
#ifdef weak_alias
weak_alias(special_subroutine_1, special_subroutine)
weak_alias(special_subroutine_1, special_subroutine)
#endif

void special_subroutine(void){
....//some computation
}

int main(int argc, char** argv){
...
special_subroutine_1( );
....
special_subroutine_2( );
}

------------------------------------------------------

Jul 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"se*********@hotmail.com" <se*********@hotmail.comwrites:
I want to use alias to call a defined function (special_subroutine in
this example) using different names (special_subroutine_1 and
special_subroutine_2 in this example), is it doable? --I tried the
following way, and it did not work when I tried to compile it with
gcc. I guess weak_alias is only valid for glibc, or maybe the way I use
it was wrong.

Can someone give me a suggestion?
There is nothing called "weak_alias" or "strong_alias" in standard C.

Followups to comp.unix.programmer.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.