When using an older GCC, the compiler doesn't recognize the attribute gnu::fallthrough, this patch fixes the warnings.
The other three warnings are still present in GCC 7
FIXED: [ 390994 ] [dev] Compiler warnings with gcc-6.4.0
BUG: 390994
martinkostolny |
Krusader |
When using an older GCC, the compiler doesn't recognize the attribute gnu::fallthrough, this patch fixes the warnings.
The other three warnings are still present in GCC 7
FIXED: [ 390994 ] [dev] Compiler warnings with gcc-6.4.0
BUG: 390994
Test with a GCC lower than 7
Lint Skipped |
Unit Tests Skipped |
Thanks, Davide, for taking care of older setups!
I cannot test with older gcc, so I'm just confirming that everything seems to work fine after compiling with gcc 7.3.0.
It also works using gcc 5.4.0 under Ubuntu 16.04 LTS (its latest Long Term Service version). Thanks!
Just to confirm, do you guys see the other 3 warnings with gcc < 7? Because all of them are valid points.
BTW, filesystem.cpp warning I already fixed with D10761, don't bother. krarc.cpp is trivial, I'm also on it. The only thing I'm not sure how to fix yet is "case 2000: //HACK for summary view" in map.cpp.
Just to confirm, do you guys see the other 3 warnings with gcc < 7?
Using Ubuntu 16_04 LTS (with gcc 5.4.0):
Those two warnings (mentioned in https://bugs.kde.org/show_bug.cgi?id=390994) are seen:
wdirs/krusader/krusader/DiskUsage/radialMap/map.cpp: In member function ‘void RadialMap::Map::colorise()’: wdirs/krusader/krusader/DiskUsage/radialMap/map.cpp:184:13: warning: case value ‘2000’ not in enumerated type ‘Filelight::MapScheme’ [-Wswitch] case 2000: //HACK for summary view wdirs/krusader/krArc/krarc.cpp: In member function ‘virtual void kio_krarcProtocol::rename(const QUrl&, const QUrl&, KIO::JobFlags)’: wdirs/krusader/krArc/krarc.cpp:778:81: warning: unused parameter ‘flags’ [-Wunused-parameter] void kio_krarcProtocol::rename(const QUrl& src, const QUrl& dest, KIO::JobFlags flags)
This warning does not appear:
wdirs/krusader/krusader/FileSystem/filesystem.cpp: In static member function ‘static FileItem* FileSystem::createLocalFileItem(const QString&, const QString&, bool)’: wdirs/krusader/krusader/FileSystem/filesystem.cpp:239:35: warning: variable length array ‘buffer’ is used [-Wvla] char buffer[stat_p.st_size];
Although others warnings are seen (it's an old gcc version):