Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 719790

Summary: 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]
Product: Gentoo Linux Reporter: Frederik Pfautsch <bugs>
Component: Current packagesAssignee: Gentoo Shell Tools Herd Bugs <shell-tools>
Status: UNCONFIRMED ---    
Severity: normal CC: bugs, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Compile log procinfo
emerge info

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