Building with openSuse Leap 15.5

Johannes Zarl-Zierl johannes at zarl-zierl.at
Thu Sep 7 23:34:14 BST 2023


Hi Andreas,


Am Donnerstag, 7. September 2023, 23:15:33 CEST schrieben Sie:
> >> /home/usr/src/kphotoalbum-git/kphotoalbum/lib/kpabase/SettingsData.h:70:2
> >> 4:w arning: extra ‘;’ [-Wpedantic]
> >> Q_FLAG_NS(VideoBackend);
> > [..]
> > It's fixed now...
> no, it is not. I should have been clearer: this warning pops up with
> nearly every *h file. See below. I guess it is some change in the
> pedantic defaults for the compiler. These are the config lines:

> [...]
> CMakeFiles/kphotoalbum.dir/Settings/CategoryPage.cpp.o
> In file included from
> /home/usr/src/kphotoalbum-git/kphotoalbum/Settings/CategoryItem.cpp:9:0:
> /home/usr/src/kphotoalbum-git/kphotoalbum/DB/ImageDB.h:58:45:warning:
> extra ‘;’ [-Wpedantic]
> Q_DECLARE_FLAGS(SearchOptions, SearchOption);
> ^
> /home/usr/src/kphotoalbum-git/kphotoalbum/DB/ImageDB.h:59:24:warning:
> extra ‘;’ [-Wpedantic]
> Q_FLAG_NS(SearchOption);
> ^
> [...]

If I add -Wpedantic to CMAKE_CXX_FLAGS, I get loads of warnings about variadic 
macros("must specify at least one argument for '...' parameter of variadic 
macro [-Wgnu-zero-variadic-macro-arguments]"), but none about the extra 
semicolons.

Given that code like 'qCWarning(MyLogCategory) << "my warning";' is part of 
the official Qt API docs, I'm not going to rewrite all occurences...

So my takeaway is that there's a reason why we don't add -Wpedantic by 
default: if it can't produce halfway consistent warnings, it is not of much 
use...

Btw. I tested with clang++ 11.1.0 and  gcc 13.2.0.

Cheers,
  Johannes




More information about the KPhotoAlbum mailing list