Summary: | gcompris compilation warnings (gcc7, and gcc8) | ||
---|---|---|---|
Product: | [Applications] gcompris | Reporter: | Bruno Friedmann <bruno> |
Component: | general | Assignee: | Jazeix Johnny <jazeix> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | animtim, jazeix |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Bruno Friedmann
2018-05-21 13:40:22 UTC
During build core/ActivityInfo.cpp & ApplicationSettings.h warning: comparison between signed and unsigned integer expressions [-Wsign-compare] cd /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/build/src/core && /usr/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SENSORS_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -I/home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/build/src/core -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtXmlPatterns -isystem /usr/include/qt5/QtSvg -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtXml -isystem /usr/include/qt5/QtSensors -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fPIE -pie -fno-strict-aliasing -DNDEBUG -DNDEBUG -std=c++11 -O2 -g -DNDEBUG -fPIC -std=gnu++11 -o CMakeFiles/gcompris-qt.dir/ActivityInfo.cpp.o -c /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ActivityInfo.cpp In file included from /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ActivityInfo.cpp:28:0: /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettings.h: In member function 'void ApplicationSettings::setPreviousHeight(qint32)': /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettings.h:298:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(m_previousHeight != height) { ~~~~~~~~~~~~~~~~~^~~~~~~~~ /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettings.h: In member function 'void ApplicationSettings::setPreviousWidth(qint32)': /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettings.h:306:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(m_previousWidth != width) { ~~~~~~~~~~~~~~~~^~~~~~~~ make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/build' ---- /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ActivityInfoTree.cpp: In lambda function: /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ActivityInfoTree.cpp:161:64: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] return activity->difficulty() < levelMin || activity->difficulty() > levelMax; ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ActivityInfoTree.cpp:161:101: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] return activity->difficulty() < levelMin || activity->difficulty() > levelMax; ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ ---- /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettingsDefault.cpp: In member function 'uint ApplicationSettings::checkActivationCode(const QString&)': /home/abuild/rpmbuild/BUILD/gcompris-qt-0.91/src/core/ApplicationSettingsDefault.cpp:55:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ok = year * 100 + month + 200 >= atoi(BUILD_DATE); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ Thanks Bruno for the report. For the configure part, I don't have those warnings on any of my build setups, so I guess they come from a newer cmake version than the ones we use to do the pacakges. So, not sure if we should change that already in our sources for now. For the build warnings, I never noticed those, but I know we have other warnings coming from our external-embedded dependency qml-box2d, so they might have hidden between those making me not notice them. We will check. Hi Timothé the expanded result of our %cmake macros is the following rpm --eval %cmake find . -name CMakeLists.txt \ -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\)/{s/^/#IGNORE /}' {} + mkdir -p build cd build /usr/bin/cmake $OLDPWD/. \ %if "/usr/bin/make" == "/usr/bin/make" -G"Unix Makefiles" \ %else -GNinja \ %endif -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DINCLUDE_INSTALL_DIR:PATH=/usr/include \ -DLIB_INSTALL_DIR:PATH=/usr/lib64 \ -DSYSCONF_INSTALL_DIR:PATH=/etc \ -DSHARE_INSTALL_PREFIX:PATH=/usr/share \ -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_C_FLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_CXX_FLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_Fortran_FLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \ %if "lib64" == "lib64" -DLIB_SUFFIX=64 \ %endif -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_STATIC_LIBS:BOOL=OFF \ -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \ -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \ -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules I'm not using GNinja. Hope this can help a bit more. At anytime you can go back to the build log it has all the details. Hi, for cmake the issues come from the parameters you give to the command line: "-DINCLUDE_INSTALL_DIR:PATH=/usr/include" and the related warning: "INCLUDE_INSTALL_DIR is deprecated, use KDE_INSTALL_INCLUDEDIR instead." Can you try to change the cmake line with the not deprecated variables? According to the documentation (https://api.kde.org/ecm/kde-module/KDEInstallDirs.html#kde-module:KDEInstallDirs), it should work the same. For the build, I'll check the warnings, they only appear when adding some options to the compiler flags (-Wall). It's "just" comparisons between unsigned and signed integer but will be still better to remove them. Johnny Code warnings fixed on https://phabricator.kde.org/R2:459b7df47a95b56bb4e94ff971eaa0cf3a37568f + cmake policy set |