More symbol export stuff -- GCC Visibility patch

Karl Vogel karl.vogel at seagha.com
Sun Jul 18 22:59:05 CEST 2004


While playing with this symbol stuff.. I noticed that other libs were also 
exporting way more than needed.

For instance... libkateinterfaces has exports for all the private methods & 
private slots of all the classes it implements. 

I was able to reduce the symbols by manually adding an attribute to the 
private parts (source parts.. not the other kind :-) ... ie.

#define HIDE  __attribute__((visibility ("hidden"))

and then..

  private:
	void methodX() HIDE;


This worked.. but it seemed strange that there was no better way to do this.. 
so I put the question to gcc-devel:

  http://thread.gmane.org/gmane.comp.gcc.devel/51574


Esp. the answer of Giovanni Bajo was interesting, pointing me to this webpage:

GCC Symbol Visibility Patch    	
http://www.nedprod.com/programs/gccvisibility.html


Reading through the gcc PR issues.. I noticed a familiar name.. so guess some 
KDE developers are already onto this.

Has the dllexport/dlllocal macro as shown on the gcc visibility patch page 
been considered yet?! (ie. for KDE4 coding style)



More information about the Kde-optimize mailing list