Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719790 - app-admin/procinfo-ng-2.0.304-r1 -- clang: ./lib/timeRoutines.cpp:134:38: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
Summary: app-admin/procinfo-ng-2.0.304-r1 -- clang: ./lib/timeRoutines.cpp:134:38: err...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Shell Tools Herd Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-27 11:57 UTC by Frederik Pfautsch
Modified: 2020-04-29 21:33 UTC (History)
2 users (show)

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


Attachments
Compile log procinfo (app-admin:procinfo-ng-2.0.304-r1:20200427-112022.log,16.63 KB, text/x-log)
2020-04-27 11:57 UTC, Frederik Pfautsch
Details
emerge info (emerge.info,5.75 KB, application/x-info)
2020-04-27 11:58 UTC, Frederik Pfautsch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Pfautsch 2020-04-27 11:57:59 UTC
Created attachment 634848 [details]
Compile log procinfo

From the compile log:

<...>
./lib/timeRoutines.cpp:134:38: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
                { tm_sec: result1.seconds, tm_min: result1.minutes, tm_hour: result1.hours,
                                                   ^~~~~~~~~~~~~~~
./lib/timeRoutines.cpp:134:38: note: insert an explicit cast to silence this issue
                { tm_sec: result1.seconds, tm_min: result1.minutes, tm_hour: result1.hours,
                                                   ^~~~~~~~~~~~~~~
                                                   static_cast<int>( )
./lib/timeRoutines.cpp:134:64: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
                { tm_sec: result1.seconds, tm_min: result1.minutes, tm_hour: result1.hours,
                                                                             ^~~~~~~~~~~~~
./lib/timeRoutines.cpp:134:64: note: insert an explicit cast to silence this issue
                { tm_sec: result1.seconds, tm_min: result1.minutes, tm_hour: result1.hours,
                                                                             ^~~~~~~~~~~~~
                                                                             static_cast<int>( )
./lib/timeRoutines.cpp:135:12: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
                tm_wday: result1.days, tm_week: result1.weeks };
                         ^~~~~~~~~~~~
./lib/timeRoutines.cpp:135:12: note: insert an explicit cast to silence this issue
                tm_wday: result1.days, tm_week: result1.weeks };
                         ^~~~~~~~~~~~
                         static_cast<int>( )
./lib/timeRoutines.cpp:135:35: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'int' in initializer list [-Wc++11-narrowing]
                tm_wday: result1.days, tm_week: result1.weeks };
<...>

Builds fine when using gcc instead of clang.

clang --version:
clang version 9.0.1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/9/bin

gcc --version:
gcc (Gentoo 9.2.0-r2 p3) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
Comment 1 Frederik Pfautsch 2020-04-27 11:58:44 UTC
Created attachment 634850 [details]
emerge info