Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, Thanks for all your fast response. So in F77, that's impossible. Well, I'm thinking another approach ... don't know if it's possible ... The reason I asked Fortran static function/subroutine is I want to avoid name space conflict. I'm not a Fortran programmer ... but want to use some math lib. (from www.netlib.org) written by Fortran in C. If I can make public subroutines to static ... then the risk for name space conflict can be avoided when I linking multiple Fortran lib together. For "SUBROUTINE FOO", if we look at the object file (or lib) by "nm" command, we will see something like: foo.o: U foo_ 00000000 T foo_ The "T" indicate that foo_ is public accessible function call. If it's local or static function .... instead of "T", the indicator will be "t". So, if "nm" can tell the different between "T" and "t" ... it should be possible to edit the object file directly by change "T" to "t" ... I strongly "FEEL" that this might work ... anyone has comment on this. Best Regards KC kccheng@linuxdaq-labs.org
Post Follow-up to this messageIn article <1117098670.031977.150050@g44g2000cwa.googlegroups.com>, KC wrote: > So, if "nm" can tell the different between "T" and "t" ... it should be > possible to edit the object file directly by change "T" to "t" ... > I strongly "FEEL" that this might work ... anyone has comment on > this. Yeah, it could probably work, in principle at least. You might need to experiment around with a binary editor. However, I think the Path of Less Pain [TM], both for you and potential users of your code, is to just choose names for your C functions that don't conflict with the library. -- Janne Blomqvist
Post Follow-up to this messageIn article <1117098670.031977.150050@g44g2000cwa.googlegroups.com>, KC <kcc1967@gmail.com> wrote: >So, if "nm" can tell the different between "T" and "t" ... it should be >possible to edit the object file directly by change "T" to "t" ... >I strongly "FEEL" that this might work ... anyone has comment on >this. Yes, I have a comment: Don't do that, it will hurt you. -- greg
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.