Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 742755 - x11-misc/rss-glx-0.9.1-r1 fails to compile with clang
Summary: x11-misc/rss-glx-0.9.1-r1 fails to compile with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2020-09-16 06:41 UTC by Agostino Sarubbo
Modified: 2021-02-21 16:32 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,53.66 KB, text/plain)
2020-09-16 06:41 UTC, Agostino Sarubbo
Details
rss-clang.patch (rss-clang.patch,1.18 KB, patch)
2021-01-22 23:08 UTC, Malcolm Lashley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-09-16 06:41:20 UTC
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.
Comment 1 Agostino Sarubbo gentoo-dev 2020-09-16 06:41:22 UTC
Created attachment 660498 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-09-16 06:41:23 UTC
Possible context of error(s):

flare.cpp:196:19: error: non-constant-expression cannot be narrowed from type
Comment 3 bob5972 2021-01-17 16:12:09 UTC
This compiles for me on GCC?
Comment 4 Oliver Freyermuth 2021-01-20 18:16:27 UTC
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.
Comment 5 Malcolm Lashley 2021-01-22 23:08:32 UTC
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 :)
Comment 6 Jonas Stein gentoo-dev 2021-01-25 01:19:22 UTC
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.
Comment 7 Larry the Git Cow gentoo-dev 2021-02-21 16:32:22 UTC
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(+)