statics everywhere. Why?

Gordon McMillan gmcm at hypernet.com
Wed Nov 10 13:30:21 EST 1999


Fredrik wrote:
> Arinte <shouldbe at message.com> wrote:
> > Embedding python in a c application, why do I need
> > to make the functions that python call and variables
> > for callbacks static?
> 
> beats me.  what happens if you don't
> make them static?

On Unix, it exposes all your internals (with unpredictable 
results) to anyone loading your .so. On Windows, this isn't a 
problem, and much of the time you can control this with linker 
/ loader options on Unix. But since C promises not to let 
anyone else know about a file static, it's both the easy and 
safe route to portability.

- Gordon




More information about the Python-list mailing list