https://bugs.kde.org/show_bug.cgi?id=392126

            Bug ID: 392126
           Summary: Compile error under Clang 5.0: rror:
                    non-constant-expression cannot be narrowed from type
                    'int' to 'uint32_t'
           Product: frameworks-kwindowsystem
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: kf...@kde.org
  Target Milestone: ---

Problem:

```
% /usr/lib/ccache/c++  -DKF5WindowSystem_EXPORTS -DQT_CORE_LIB -DQT_GUI_LIB
-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII
-DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING
-DQT_STRICT_ITERATORS -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_QSTRINGBUILDER
-DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Isrc
-I/home/kfunk/devel/src/kf5/kwindowsystem/src
-Isrc/KF5WindowSystem_autogen/include
-I/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb -isystem
/home/kfunk/devel/build/qt5.9/qtbase/include -isystem
/home/kfunk/devel/build/qt5.9/qtbase/include/QtWidgets -isystem
/home/kfunk/devel/build/qt5.9/qtbase/include/QtGui -isystem
/home/kfunk/devel/build/qt5.9/qtbase/include/QtCore -isystem
/home/kfunk/devel/build/qt5.9/qtbase/../../../src/qt5.9/qtbase/mkspecs/linux-g++
-isystem /home/kfunk/devel/build/qt5.9/qtbase/include/QtX11Extras -pipe
-DQT_STRICT_ITERATORS -DQURL_NO_CAST_FROM_STRING -DQT_NO_HTTP -DQT_NO_FTP
-Wformat -Werror=format-security -Werror=return-type -Wno-variadic-macros
-std=c++0x -fno-operator-names -fno-exceptions
-Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align
-Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef
-Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time
-fdiagnostics-color=always -pedantic -g -fPIC -fvisibility=hidden
-fvisibility-inlines-hidden   -fPIC -std=gnu++11 -MD -MT
src/CMakeFiles/KF5WindowSystem.dir/platforms/xcb/netwm.cpp.o -MF
src/CMakeFiles/KF5WindowSystem.dir/platforms/xcb/netwm.cpp.o.d -o
src/CMakeFiles/KF5WindowSystem.dir/platforms/xcb/netwm.cpp.o -c
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2762:25:
warning: cast from 'unsigned char *' to 'uint32_t *' (aka 'unsigned int *')
increases required alignment from 1 to 4 [-Wcast-align]
        uint32_t *d32 = (uint32_t *) icons[i].data;
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:13:
error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t'
(aka 'unsigned int') in initializer list [-Wc++11-narrowing]
            topology.top, topology.bottom, topology.left, topology.right, 1
            ^~~~~~~~~~~~
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:13:
note: insert an explicit cast to silence this issue
            topology.top, topology.bottom, topology.left, topology.right, 1
            ^~~~~~~~~~~~
            static_cast<uint32_t>( )                                            
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:27:
error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t'
(aka 'unsigned int') in initializer list [-Wc++11-narrowing]
            topology.top, topology.bottom, topology.left, topology.right, 1
                          ^~~~~~~~~~~~~~~
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:27:
note: insert an explicit cast to silence this issue
            topology.top, topology.bottom, topology.left, topology.right, 1
                          ^~~~~~~~~~~~~~~
                          static_cast<uint32_t>( )
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:44:
error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t'
(aka 'unsigned int') in initializer list [-Wc++11-narrowing]
            topology.top, topology.bottom, topology.left, topology.right, 1
                                           ^~~~~~~~~~~~~
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:44:
note: insert an explicit cast to silence this issue
            topology.top, topology.bottom, topology.left, topology.right, 1
                                           ^~~~~~~~~~~~~
                                           static_cast<uint32_t>( )
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:59:
error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t'
(aka 'unsigned int') in initializer list [-Wc++11-narrowing]
            topology.top, topology.bottom, topology.left, topology.right, 1
                                                          ^~~~~~~~~~~~~~
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:2846:59:
note: insert an explicit cast to silence this issue
            topology.top, topology.bottom, topology.left, topology.right, 1
                                                          ^~~~~~~~~~~~~~
                                                         
static_cast<uint32_t>( )
/home/kfunk/devel/src/kf5/kwindowsystem/src/platforms/xcb/netwm.cpp:3677:41:
warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned
int') and 'const int' [-Wsign-compare]
            if (message->data.data32[0] == OnAllDesktops) {
                ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
2 warnings and 4 errors generated.
```

% c++ --version
clang version 5.0.1-2 (tags/RELEASE_501/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to