[libvoikko] Function visibility question

Flammie Pirinen flammie at iki.fi
Tue Feb 18 06:30:45 EET 2014


2014-02-05, Flammie Pirinen sanoi:

> 2014-01-29, Harri Pitkänen sanoi:
> 
> > On Wednesday 29 January 2014 11:57:05 Sjur Moshagen wrote:
> > > I don’t understand the meaning of this warning, but the oxt seems
> > > to work just as intended. Is there anyone on the list that could
> > > tell me if the warning is significant or can be ignored? Or even
> > > better: how I can avoid the warning (ie what have I done wrong).
> > 
> > This happens because ospell.h (in hfst-ospell) contains member
> > function definitions. When the header is included in libvoikko these
> > member functions will have hidden visibility and default visibility
> > when they are included in hfst-ospell.
> > 
> > I would fix this by moving the member function definitions from
> > ospell.h to ospell.cc and re-compiling both hfst-ospell and
> > libvoikko. This would avoid the extra definition within libvoikko
> > (where at least get_key_table() is not even used). But this will be
> > API incompatible change in hfst-ospell so I'm not sure if you want
> > to do it.
>  
> I am not a big fan of having implementation code in the header files
> myself (probably some habit I picked up with C) but I've usually
> thought there are some efficiency things behind that on top of the few
> rare cases where it's required. If there's no notable regressions I'd
> be all for moving all or most of the code from headers into
> implementation files. 

No oen corrected my misconceptions here so I went ahead and moved all
implementations from headers to source files. If you've other changes
to interface that might be necessary, this would be a good time to make
them, since making these changes will aiui break all existing oxts in
sense that they won't be able to use the new interface. This is of
course probably most important on linux where users' oxts are
dynamically linked and users can actually update libhfstospell
efficiently.


-- 
Flammie, computer scientist bachelor, linguist master, free software
Finnish localiser, and more! <http://www.iki.fi/flammie/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.puimula.org/pipermail/libvoikko/attachments/20140218/14bd498f/attachment.sig>


More information about the Libvoikko mailing list