RFC: first stab at getting rid of libc_hidden_proto() forest
vda.linux at googlemail.com
Sat Apr 12 17:33:37 UTC 2008
On Saturday 12 April 2008 15:36, Joakim Tjernlund wrote:
> > > Obvious solution of adding libc_hidden_proto's to .h files
> > > does not work so well since we'd like to not pollute them with
> > > machinery which doesn't belong to public interface.
> > >
> > but we could scrub public *h at install time by removing
> > all occurences of libc_hidden_proto producing a sort of
> > sanitized libc headers, in the same way kernel does.
BTW: simply removing every line which starts with "libc_hidden_proto("
string will not work so nice:
will turn into
Scrubbing needs to be more clever than that.
> > > In the attached patch, I chose to create a "master include file"
> > > which includes almost all other headers; and then marks
> > > all exported functions(variables) with libc_hidden_proto.
> > > The file is called uClibc_libc.h.
> > >
> > I don't like this approach since I usually prefer explicitely
> > including all specific headers are areally need, no less, no more,
> > instead of a master include header.
> yes, and development will hurt too as most of uClibc will need to rebuild
> when adding some new feature.
How ofter do you change public headers? I believe most changes go into
implementation of the libc interface, not in interface.
> > This is my opinion. I agree with you about the needs of consistently
> > using libc_hidden_proto, but I'd try to find another solution.
> > Anyway, being this a big change, I'd like to hear other opinions
> > and comment.
> > Mike, Jocke, Bernds, Peter others... what do you think ?
> Scrubbing headers like Linux do is the best. There will probably be other
> things in there too that would benefit from such scrubbing.
Sounds reasonable. What method do you prefer?
#ifdef blocks with a special #define which are removed by scrubber script?
Magic comment? Scrubber script will just delete it and everything below
till the end of file:
/* *** UCLIBC_INTERNAL *** */
Other method I didn't think about?
More information about the uClibc