Bug 364352 - Shouldn't qca_safetimer.h use Q_SLOTS and Q_SIGNALS?
Summary: Shouldn't qca_safetimer.h use Q_SLOTS and Q_SIGNALS?
Status: RESOLVED FIXED
Alias: None
Product: qca
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 2.1.0
Platform: Compiled Sources macOS
: NOR major
Target Milestone: ---
Assignee: Ivan Romanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-15 17:13 UTC by RJVB
Modified: 2016-06-19 11:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.1.1
Sentry Crash Report:


Attachments
use Q_SLOTS and Q_SIGNALS in qca_safetimer.h (378 bytes, patch)
2016-06-15 17:14 UTC, RJVB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2016-06-15 17:13:13 UTC
Building okteta 16.04.2 on OS X I ran into a weird compile error:

```
...
In file included from ..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp:31:
In file included from /opt/local/include/qt5/QtCrypto/QtCrypto:1:
In file included from /opt/local/include/qt5/QtCrypto/qca.h:46:
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:47:7: error: expected ':'
public slots:
      ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:47:8: error: unknown type name 'slots'
public slots:
       ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:48:7: error: expected '(' for function-style cast or type construction
        void start(int msec);
        ~~~~ ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:52:1: error: unknown type name 'signals'; did you mean 'sigval'?
signals:
^
/usr/include/sys/signal.h:155:7: note: 'sigval' declared here
union sigval {
      ^
In file included from ..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp:31:
In file included from /opt/local/include/qt5/QtCrypto/QtCrypto:1:
In file included from /opt/local/include/qt5/QtCrypto/qca.h:46:
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:53:7: error: expected '(' for function-style cast or type construction
        void timeout();
        ~~~~ ^
5 errors generated.
make[1]: *** [kasten/controllers/CMakeFiles/OktetaKastenControllers.dir/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o] Error 1
make[1]: Leaving directory `..../kf5-okteta/work/build'
make: *** [view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o] Error 2
make: Leaving directory `..../kf5-okteta/work/build/kasten/controllers'
```

I've gone over the precompiled file but couldn't put my finger on anything wrong in particular. The suggestion that I might mean `sigval` instead of `signals` made me try a simple patch to qca_safetimer.h (attached), and that helped.

Reproducible: Always

Steps to Reproduce:
1. start a build of okteta 16.04.2 with QCA-Qt5 installed
2. wait for the error


Actual Results:  

```
cd ..../kf5-okteta/work/build && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f kasten/controllers/CMakeFiles/OktetaKastenControllers.dir/build.make kasten/controllers/CMakeFiles/OktetaKastenControllers.dir/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o
make[1]: Entering directory `..../kf5-okteta/work/build'
[ 23%] Building CXX object kasten/controllers/CMakeFiles/OktetaKastenControllers.dir/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o
cd ..../kf5-okteta/work/build/kasten/controllers && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++   -DKCOREADDONS_LIB -DOktetaKastenControllers_EXPORTS -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_MAC_USE_COCOA -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_PRINTSUPPORT_LIB -DQT_SCRIPT_LIB -DQT_STRICT_ITERATORS -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_XML_LIB -DTRANSLATION_DOMAIN=\"liboktetakasten\" -D_DARWIN_C_SOURCE -D_LARGEFILE64_SOURCE -I..../kf5-okteta/work/build/kasten/controllers -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearrayfilter -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libfinddialog -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/../../libs/framesprint -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearrayfilter/filter -I..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/algorithm -I..../kf5-okteta/work/build/kasten/gui -I..../kf5-okteta/work/okteta-16.04.2/kasten/gui -I..../kf5-okteta/work/build/kasten/core -I..../kf5-okteta/work/okteta-16.04.2/kasten/core -I..../kf5-okteta/work/build/libs/kasten/core -I..../kf5-okteta/work/okteta-16.04.2/libs/kasten/core -I..../kf5-okteta/work/build/core -I..../kf5-okteta/work/okteta-16.04.2/core -I..../kf5-okteta/work/build/libs/kasten/gui -I..../kf5-okteta/work/okteta-16.04.2/libs/kasten/gui -I..../kf5-okteta/work/build/gui -I..../kf5-okteta/work/okteta-16.04.2/gui -isystem /opt/local/include/KF5/KIOCore -isystem /opt/local/include/KF5 -isystem /opt/local/include/KF5/KCoreAddons -iframework /opt/local/libexec/qt5/Library/Frameworks -isystem /opt/local/libexec/qt5/Library/Frameworks/QtCore.framework/Headers -isystem /opt/local/share/qt5/mkspecs/macx-clang -isystem /opt/local/include/KF5/KService -isystem /opt/local/include/KF5/KConfigCore -isystem /opt/local/libexec/qt5/Library/Frameworks/QtGui.framework/Headers -isystem /System/Library/Frameworks/OpenGL.framework/Headers -isystem /opt/local/libexec/qt5/Library/Frameworks/QtWidgets.framework/Headers -isystem /opt/local/include/KF5/KXmlGui -isystem /opt/local/libexec/qt5/Library/Frameworks/QtDBus.framework/Headers -isystem /opt/local/libexec/qt5/Library/Frameworks/QtXml.framework/Headers -isystem /opt/local/include/KF5/KConfigWidgets -isystem /opt/local/include/KF5/KCodecs -isystem /opt/local/include/KF5/KWidgetsAddons -isystem /opt/local/include/KF5/KConfigGui -isystem /opt/local/include/KF5/KAuth -isystem /opt/local/include/KF5/KI18n -isystem /opt/local/include/KF5/KCompletion -isystem /opt/local/libexec/qt5/Library/Frameworks/QtScript.framework/Headers -isystem /opt/local/include/KF5/KNewStuff3 -isystem /opt/local/include/KF5/Attica -isystem /opt/local/include/KF5/Attica/c++ -isystem /opt/local/libexec/qt5/Library/Frameworks/QtNetwork.framework/Headers -isystem /opt/local/include/KF5/KCMUtils -isystem /opt/local/include/KF5/KIconThemes -isystem /opt/local/libexec/qt5/Library/Frameworks/QtPrintSupport.framework/Headers -isystem /opt/local/include/qt5/QtCrypto  -O3 -march=native -g -DNDEBUG -DQT_USE_EXTSTANDARDPATHS -DQT_EXTSTANDARDPATHS_XDG_DEFAULT=true -stdlib=libc++  -std=c++0x -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -arch x86_64 -mmacosx-version-min=10.9 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -Wall -fPIC -o CMakeFiles/OktetaKastenControllers.dir/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o -c ..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp
In file included from ..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp:31:
In file included from /opt/local/include/qt5/QtCrypto/QtCrypto:1:
In file included from /opt/local/include/qt5/QtCrypto/qca.h:46:
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:47:7: error: expected ':'
public slots:
      ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:47:8: error: unknown type name 'slots'
public slots:
       ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:48:7: error: expected '(' for function-style cast or type construction
        void start(int msec);
        ~~~~ ^
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:52:1: error: unknown type name 'signals'; did you mean 'sigval'?
signals:
^
/usr/include/sys/signal.h:155:7: note: 'sigval' declared here
union sigval {
      ^
In file included from ..../kf5-okteta/work/okteta-16.04.2/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp:31:
In file included from /opt/local/include/qt5/QtCrypto/QtCrypto:1:
In file included from /opt/local/include/qt5/QtCrypto/qca.h:46:
/opt/local/include/qt5/QtCrypto/qca_safetimer.h:53:7: error: expected '(' for function-style cast or type construction
        void timeout();
        ~~~~ ^
5 errors generated.
make[1]: *** [kasten/controllers/CMakeFiles/OktetaKastenControllers.dir/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o] Error 1
make[1]: Leaving directory `..../kf5-okteta/work/build'
make: *** [view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp.o] Error 2
make: Leaving directory `..../kf5-okteta/work/build/kasten/controllers'
```


Expected Results:  
succesfull build
Comment 1 RJVB 2016-06-15 17:14:11 UTC
Created attachment 99521 [details]
use Q_SLOTS and Q_SIGNALS in qca_safetimer.h
Comment 2 Rolf Eike Beer 2016-06-19 10:32:30 UTC
Which version of qca are you using? It should be fixed in 2.1.1, see https://quickgit.kde.org/?p=qca.git&a=commit&h=66b9754170759d9333d5fc1e348642814d0310dd
Comment 3 RJVB 2016-06-19 11:50:16 UTC
I'm using 2.1.0.3 so that figures. Sorry for the noise (I did check for newer release versions before filing this bug).