[Bug 38835] strip out non-trivial globals before main

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Feb 27 04:54:37 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=38835

--- Comment #6 from Jan Holesovsky <kendy at collabora.com> ---
Let me add some more information to this Easy Hack, as it would be really quite
useful to improve the situation :-)

The simplest way to find global statics is like:

git grep '^static[^(]*$' -- "*.cxx"

and look after those that define a global variable of a more complex type (ie.
skip the OUStrings / bools / ints for now).

Then as the first thing, try to make it non-global if it is possible, like
here:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=92bede3900e84d4f08efb81757ec95c518c7fa76

because that way this will get initialized when used for the first time.  If
that is not possible, or not practical, then you can do what is suggested in
the initial comment.  An example can be seen in this commit:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=020e29fb95d742b160feab1df6751e59d4108239

Hope that helps :-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140227/723cf5e5/attachment.html>


More information about the LibreOffice mailing list