Silence warnings in TabBoxHandler
ClosedPublic

Authored by graesslin on Jan 20 2019, 1:12 PM.

Details

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Jan 20 2019, 1:12 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 20 2019, 1:12 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
graesslin requested review of this revision.Jan 20 2019, 1:12 PM
zzag added a subscriber: zzag.Jan 20 2019, 2:23 PM

I don't see any warnings. Could you please provide the warning message?

Also, speaking of warnings, we have 500+ new warnings https://build.kde.org/job/Plasma/job/kwin/job/kf5-qt5%20SUSEQt5.11/320/warnings30Result/NORMAL/

In D18406#396909, @zzag wrote:

I don't see any warnings. Could you please provide the warning message?

No, I cannot. Someone thought it's a good idea to turn KWin into a warning mess.

Also, speaking of warnings, we have 500+ new warnings https://build.kde.org/job/Plasma/job/kwin/job/kf5-qt5%20SUSEQt5.11/320/warnings30Result/NORMAL/

See https://cgit.kde.org/extra-cmake-modules.git/commit/?id=7d73c6744f6455c585a6e059cf2753fcf20a870a

I guess this needs either to be reverted or disabled in KWin.

ngraham added a subscriber: aacid.Jan 20 2019, 4:46 PM
zzag added a comment.Jan 20 2019, 4:57 PM

Yeah, I saw it before.

I guess this needs either to be reverted or disabled in KWin.

I don't think -Wsuggest-override will be reverted because it is a good thing. I think we have two options, either disable the warning or fix it. Regarding the latter, we could use clang-tidy, e.g. P290. Anyway, that's probably off-topic stuff, sorry for driving in this direction.


I think all cases are covered so there should not be any warnings generated by compiler.

Regarding the latter, we could use clang-tidy,

That's what's been done over the rest of Plasma. We've not had issues.

aacid removed a subscriber: aacid.Jan 20 2019, 7:29 PM

Now I have the warnings again:

/home/martin/src/kde/workspace/kwin/tabbox/tabboxhandler.cpp: In member function ‘QModelIndex KWin::TabBox::TabBoxHandler::nextPrev(bool) const’:
/home/martin/src/kde/workspace/kwin/tabbox/tabboxhandler.cpp:465:34: warning: ‘model’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             row = model->rowCount() - 1;
                   ~~~~~~~~~~~~~~~^~
/home/martin/src/kde/workspace/kwin/tabbox/tabboxhandler.cpp: In member function ‘QModelIndex KWin::TabBox::TabBoxHandler::first() const’:
/home/martin/src/kde/workspace/kwin/tabbox/tabboxhandler.cpp:611:29: warning: ‘model’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     return model->index(0, 0);
                             ^
zzag accepted this revision.Jan 27 2019, 11:03 AM

Though I don't see -Wmaybe-uninitialized in my build logs.

This revision is now accepted and ready to land.Jan 27 2019, 11:03 AM
In D18406#400808, @zzag wrote:

Though I don't see -Wmaybe-uninitialized in my build logs.

Probably different compiler version. It must be relatively new as otherwise I would have noticed earlier.

zzag added a comment.Jan 27 2019, 11:41 AM

Probably different compiler version. It must be relatively new as otherwise I would have noticed earlier.

Out of curiosity: what compiler do you use? :-)

This revision was automatically updated to reflect the committed changes.

gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

zzag added a comment.Jan 27 2019, 12:38 PM

Mine is 8.2.1. GCC folks probably improved handling of switch cases.