https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: x11-misc/rss-glx-0.9.1-r1 fails to compile. Discovered on: amd64 (internal ref: tinderbox) NOTE: This machine uses a clang/LLVM toolchain. If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue is strictly related to the LLD linker, please block bug 731004. This machine uses also GLIBC-2.32. If you think that this issue is strictly related to GLIBC please block bug 736174.
Created attachment 660498 [details] build.log build log and emerge --info
Possible context of error(s): flare.cpp:196:19: error: non-constant-expression cannot be narrowed from type
This compiles for me on GCC?
This seems to be strictly related to clang/LLVM, since clang seems to treat ""c++11-narrowing" as an error by default (unlike gcc). Full gcc behaviour is documented and reasoned here: https://gcc.gnu.org/wiki/FAQ#Wnarrowing As mentioned in that explanation, the standard does not oblige the compiler to issue an error (a "diagnostic message" is required). so neither compiler is "wrong", clang/LLVM is just more harsh here.
Created attachment 684166 [details, diff] rss-clang.patch The attached (entirely trivial) patch fixes the Narrowing warnings for clang. (Tested with clang-11) Please keep this eye-candy :)
ago, could you please test the patch on the tinderbox and report or merge? It would be great to get the pkg patched and we should keep it in the tree. It seems to have several users.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ea1c6d466de8412a60fc576c6f3140104367323 commit 0ea1c6d466de8412a60fc576c6f3140104367323 Author: Alexander Miller <alex.miller@gmx.de> AuthorDate: 2021-02-21 16:31:54 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2021-02-21 16:31:54 +0000 x11-misc/rss-glx: Fix C++11 narrowing issues This fixes building with clang. Thanks to Malcolm Lashley for the patch. Closes: https://bugs.gentoo.org/742755 Signed-off-by: Alexander Miller <alex.miller@gmx.de> Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: David Seifert <soap@gentoo.org> .../files/rss-glx-0.9.1-c++11-narrowing.patch | 22 ++++ x11-misc/rss-glx/rss-glx-0.9.1-r2.ebuild | 129 +++++++++++++++++++++ 2 files changed, 151 insertions(+)