[libvoikko] Function visibility question

Flammie Pirinen flammie at iki.fi
Wed Feb 5 07:30:58 EET 2014


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. 
-- 
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/20140205/9c07542a/attachment.sig>


More information about the Libvoikko mailing list