Download it now!
Bug 97966 - Drop 'static' for functions inside unnamed namespaces
Summary: Drop 'static' for functions inside unnamed namespaces
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2016-02-18 09:08 UTC by Tor Lillqvist
Modified: 2017-02-14 08:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tor Lillqvist 2016-02-18 09:08:32 UTC
We have in many places functions inside unnamed namespaces that are declared 'static' too. That is not really useful, and only causes confusion when somebody notices it and starts wondering whether there is some deeper reason for it. Your task is to find such and drop the 'static' keyword.

I don't give any code pointers as the very task is to find these cases and handle them. 

Obviously you must make sure the code still compiles and passes 'make check' after your changes.

Don't do anything else in changes submitted for this task. Don't submit one massive change for every instance, but split it up in reasonably sized bits.

As such, this task is probably too easy to qualify somebody as a potential GSoC participant for us. But if you write a Clang plug-in to do it instead of doing it manually, we will be more impressed.
Comment 1 Stephan Bergmann 2016-02-18 09:20:18 UTC
(In reply to Tor Lillqvist from comment #0)
> As such, this task is probably too easy to qualify somebody as a potential
> GSoC participant for us. But if you write a Clang plug-in to do it instead
> of doing it manually, we will be more impressed.

For how to write a Clang plugin for LO, see compilerplugins/README in the LO source tree, and the links from there.
Comment 2 Robinson Tryon (qubit) 2016-02-18 14:35:53 UTC Comment hidden (obsolete)
Comment 3 David Tardon 2016-03-03 09:21:12 UTC
Please don't assign to yourself--this is a task multiple people can work on in parallel.
Comment 4 Tamas Bunth 2016-03-03 09:58:50 UTC
Hi,
Sorry for the assignment. I would like to work on it. I'd like to write a Clang plugin. However, I have a question. Should this issue be checked in the entire project, in every c++ code? Another question is that is this comment field the right place to ask questions about the bug?
Comment 5 jani 2016-03-03 10:24:56 UTC
(In reply to Tamas Bunth from comment #4)
> Hi,
> Sorry for the assignment. I would like to work on it. I'd like to write a
> Clang plugin. However, I have a question. Should this issue be checked in
> the entire project, in every c++ code? Another question is that is this
> comment field the right place to ask questions about the bug?

Welcome, we have made a step by step guide to help new people:

https://wiki.documentfoundation.org/Development/GetInvolved

Of course it should be checked over the entire project, writing a Clang plugin takes care of that.

The comment field is in general the right place and the code pointer you need is in comment #1. You can also use mail and IRC (see wiki) for questions.
Comment 6 Jakub Trzebiatowski 2016-03-07 16:04:08 UTC
Should the clang plugin rewrite these functions or just warn about them?

Regards
Comment 7 Tor Lillqvist 2016-03-07 16:07:05 UTC
Jakub: The more the better, of course;) But note that Tamas already is (claims to be) working on this.
Comment 8 Commit Notification 2016-03-08 17:33:14 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7218090791da47aa37292f16bc1fa6f30607a58a

tdf#97966 Drop static keywords from two functions inside an unnamed namespace

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2016-03-11 08:40:37 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=83452dd0836fe0da96095a322231d837fc31934b

tdf#97966 redundant static keywords removed 6

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2016-03-11 08:52:05 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=951917e73cc5d52453830daa47fd30b5fd834bc0

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-03-11 08:54:35 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-03-11 08:57:07 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7a0b8decb7d81fefced39ee04368dd0112e8ac28

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2016-03-11 08:59:36 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=018c6adf85097d07a0b0fbce3d7155ca5a369ae1

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2016-03-11 08:59:40 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9a13cff64783a7de3dce7d484c150605bd42a4d6

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2016-03-11 09:02:06 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97966: Remove 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Tamas Bunth 2016-03-17 09:42:18 UTC
I made a plugin but I couldn't bulid it, not even the tutorial1.

I made a copy to the clang folder.
For the command "make compilerplugins" I got "Nothing to be done for 'compilerplugins'".

I tried "make compilerplugins.clear" but it doesn't help: "No rule to make target `compilerplugins.clear'"

I followed this doc: https://wiki.documentfoundation.org/Development/Clang_plugins
Comment 17 Stephan Bergmann 2016-03-21 10:18:04 UTC
(In reply to Tamas Bunth from comment #16)
> For the command "make compilerplugins" I got "Nothing to be done for
> 'compilerplugins'".
> 
> I tried "make compilerplugins.clear" but it doesn't help: "No rule to make
> target `compilerplugins.clear'"
> 
> I followed this doc:
> https://wiki.documentfoundation.org/Development/Clang_plugins

Did you configure the LO build with --enable-compiler-plugins (it is disabled by default unless you also configured --enable-dbgutil)?  Do you have the LLVM/Clang development headers installed (if you use a distro's clang package, they often come in an additional package that needs to be installed explicitly, e.g. see the "Clang Setup" slide of <http://conference.libreoffice.org/assets/Conference/Aarhus/Slides/SBergmanLOCON2015-plugin.pdf>)?
Comment 18 Tamas Bunth 2016-03-25 00:10:04 UTC
(In reply to Stephan Bergmann from comment #17) 
> Did you configure the LO build with --enable-compiler-plugins (it is
> disabled by default unless you also configured --enable-dbgutil)?  Do you
> have the LLVM/Clang development headers installed (if you use a distro's
> clang package, they often come in an additional package that needs to be
> installed explicitly, e.g. see the "Clang Setup" slide of
> <http://conference.libreoffice.org/assets/Conference/Aarhus/Slides/
> SBergmanLOCON2015-plugin.pdf>)?

Solved, thank you.
Comment 19 Commit Notification 2016-03-30 14:27:09 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=14060e76e33cfb305c1469fecf7db688bf8a8858

tdf#97966 Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2016-04-01 06:46:11 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0b8e5ca5a25dfe9f20b098fdbd94f7e9f223f5c7

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2016-04-01 06:46:15 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=62d1632498d92b6e73b952c9d379edebe3052341

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Commit Notification 2016-04-01 06:49:00 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9e596250a6e968c5d1e2fb0de582ae242e02acf9

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2016-04-01 06:49:04 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=20ba5d464a9fba3090af6a644a331ee237356fea

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2016-04-01 06:49:08 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1271eadfac7e77ff7b249e64be3857ffdc0a261c

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2016-04-01 06:49:12 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Commit Notification 2016-04-01 06:49:16 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2016-04-01 06:49:20 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9af411abce1e22d55b73d5bbac3b7a6a8535eb3b

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2016-04-01 06:49:24 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=84fd42c1f58627f3e03ee6062fa2812a4890d941

tdf#97966  Drop 'static' keywords

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 29 Commit Notification 2016-04-01 06:49:28 UTC
Wastack committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97966 Compiler plugin

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 30 Tor Lillqvist 2016-04-05 07:51:40 UTC
We probably can resolve this bug now that there is a plug-in that will mark all occurences?