Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937539 - gnome-extra/gnome-system-monitor-46 does not compile on clang due to invalid c++11-narrowing [PATCH]
Summary: gnome-extra/gnome-system-monitor-46 does not compile on clang due to invalid ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2024-08-08 00:22 UTC by David Carlos Manuelda
Modified: 2024-09-08 16:56 UTC (History)
4 users (show)

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


Attachments
emerge --info (emergeinfo.txt,21.38 KB, text/plain)
2024-08-08 00:23 UTC, David Carlos Manuelda
Details
Full build log (build.log,545.53 KB, text/x-log)
2024-08-08 00:23 UTC, David Carlos Manuelda
Details
Patch fixing compile (0001-Fix-for-invalid-c-11-narrowing-to-make-clang-compile.patch,839 bytes, patch)
2024-08-08 00:28 UTC, David Carlos Manuelda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2024-08-08 00:22:46 UTC
When trying to compile gnome-system-monitor-46.0-r1 I found that it does not compile in al LLVM profile with clang with the error (full log attached below):

../gnome-system-monitor-46.0/src/proctable.cpp:106:25: error: type 'gdouble' (aka 'double') cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
../gnome-system-monitor-46.0/src/proctable.cpp:106:28: error: type 'gdouble' (aka 'double') cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]

I'm attaching below a little patch which fixes the compile issue
Comment 1 David Carlos Manuelda 2024-08-08 00:23:25 UTC
Created attachment 899485 [details]
emerge --info
Comment 2 David Carlos Manuelda 2024-08-08 00:23:52 UTC
Created attachment 899486 [details]
Full build log
Comment 3 David Carlos Manuelda 2024-08-08 00:28:25 UTC
Created attachment 899487 [details, diff]
Patch fixing compile

This only promotes explicitelly gdouble to gint for calling the constructor and avoiding the narrowing error
Comment 4 Pacho Ramos gentoo-dev 2024-08-09 09:15:38 UTC
Thanks for the patch

Was this send to upstream?
Comment 5 David Carlos Manuelda 2024-08-09 09:29:59 UTC
(In reply to Pacho Ramos from comment #4)
> Thanks for the patch
> 
> Was this send to upstream?

No, I just focused on having it working on my system
Comment 6 Pacho Ramos gentoo-dev 2024-08-09 10:14:23 UTC
It would be nice if you could send it to:
https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/issues

Otherwise we will need to carry the patch forever

Thanks