pppd namespace pollution

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Fri Mar 21 18:57:11 UTC 2003


Till Strautmann wrote:

> >>space,
> >>	- If you modify all the globals, tracking changes  of the original 
> >>packages and apply them becomes a nightmare,
> >>
> >Exactly. That's why I say, that renaming globals can only be considered
> >as a workaround and a systematic solution is needed, instead.
> >
> Well, some kludge is not hard to find:
> 
>   1) build the library.
>   2) find exported symbols:      nm --defined-only -g  libxxx.a
>   3) sed the sources, adding a unique prefix to all exported globals. 
> [there's a risk of corrupting
>       commenting text, e.g.
>           int debug; /* set debug to print debug messages */
>       becomes
>           int pppxz67_debug; /* set pppxz67_debug to print pppxz67_debug 
> messages */
>       but that's probably acceptable.]
> 
> If the prefix is properly chosen, it can easily be removed again (useful 
> when tracking changes
> of the original package).
>  
> Even with such an approach I'm a proponent of maintaining separate 
> libraries.
> 

I think, both approaches should be followed. Putting modules 
like pppd in external libs will hide the namespace problem for 
the main source tree, but the poor guy that wants to use the 
"external" libraries has to tinker around once again... 

So Tills proposal really sounds interesting to me. Although it 
should possibly be avoided to "rename" the offical calls (the 
user's interface) to these libraries...

wkr,
	Thomas.


> -- Till

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm




More information about the users mailing list