reduce usage of FW_DEPRECATED Macro
Summary
FW_DEPRECATED macro is used to warn developpers that a specific fonction is deprecated, by printing a message in log (console or files).
Since C++17 [[deprecated]]
key words can also be used to put a warning at compilation time.
Nowadays we often use both, and this leads to have plenty of log line like this:
[419][00:00:18.406817][error] /home/mschweitzer/dev/prj_sight/src/sight/SrcLib/core/fwData/src/fwData/mt/ObjectWriteLock.cpp:36: [DEPRECATED] 'ObjectWriteLock' is deprecated. It will be removed in '21.0'
[420][00:00:18.409941][error] /home/mschweitzer/dev/prj_sight/src/sight/SrcLib/core/fwData/src/fwData/mt/ObjectWriteLock.cpp:36: [DEPRECATED] 'ObjectWriteLock' is deprecated. It will be removed in '21.0'
[421][00:00:18.416364][error] /home/mschweitzer/dev/prj_sight/src/sight/SrcLib/core/fwData/src/fwData/mt/ObjectWriteLock.cpp:36: [DEPRECATED] 'ObjectWriteLock' is deprecated. It will be removed in '21.0'
[422][00:00:18.423775][error] /home/mschweitzer/dev/prj_sight/src/sight/SrcLib/core/fwData/src/fwData/mt/ObjectWriteLock.cpp:36: [DEPRECATED] 'ObjectWriteLock' is deprecated. It will be removed in '21.0'
This is not very useful, since macro doesn't print where, in code base, should developers replace the deprecated function.
I suggest to reduce to minimum usage of FW_DEPRECATED
macro, and keep it to logical cases. And to strongly recommend usage of [[deprecated]]
keyword.
If you use a IDE with a decent configuration, you see very quickly if a function is deprecated.
Steps to reproduce
Being on latest dev branch, launch any sight application you want. Contemplate the log...
What is the current bug behavior?
Too much log.
What is the expected correct behavior?
A decent number of deprecated log. Warnings at compilation and in modern IDE.
Possible fixes
- Remove use of
FW_DEPRECATED
macro, and use[[deprecated]]
keyword, except some particular cases (to identify). - Document in our coding guidelines, when to use
[[deprecated]]
andFW_DEPRECATED
(see https://git.ircad.fr/Sight/sight-doc/issues/32)