Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: static function ? how ?
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


Report this thread to moderator Post Follow-up to this message
Old Post
KC
05-26-05 01:58 PM


Re: static function ? how ?
In 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

Report this thread to moderator Post Follow-up to this message
Old Post
Janne Blomqvist
05-26-05 08:59 PM


Re: static function ? how ?
In 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

Report this thread to moderator Post Follow-up to this message
Old Post
Greg Lindahl
05-27-05 02:00 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:31 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.