Wireshark-bugs: [Wireshark-bugs] [Bug 12483] New: [PATCH] make wireshark with qt enabled buildab

Date: Tue, 31 May 2016 23:55:32 +0000
Bug ID 12483
Summary [PATCH] make wireshark with qt enabled buildable on ARM
Product Wireshark
Version 2.0.3
Hardware ARM
OS Gentoo
Status UNCONFIRMED
Severity Normal
Priority Low
Component Qt UI
Assignee [email protected]
Reporter [email protected]

Created attachment 14607 [details]
wireshark build log

Build Information:
Paste the COMPLETE build information from "Help->About Wireshark", "wireshark
-v", or "tshark -v".
--
Build of wireshark 2.0.3 with qt enabled fails on ARM. Problem comes from the
fact that qreal is float on ARM, but double on other platforms [1]. Build fails
with the following error:


armv7a-hardfloat-linux-gnueabi-g++ -DHAVE_CONFIG_H -I. -I../..  -I../..
-I../../wiretap   -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES
-DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATION_WARNINGS
-DGDK_DISABLE_DEPRECATED  -I/usr/include
'-DPLUGIN_INSTALL_DIR="/usr/lib/wireshark/plugins/2.0.3"'  -Wall -W -Wextra
-Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -fwrapv
-fno-strict-overflow -fno-delete-null-pointer-checks -Wvla -Waddress
-Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas
-Wno-overlength-strings -Wwrite-strings -Wno-long-long -fexcess-precision=fast
-fvisibility=hidden -O2 -pipe -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
 -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -DQT_SHARED
-I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4
-I/usr/include/qt4/QtCore -pthread -I/usr/include/gtk-3.0
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -c -o conversation_colorize_action.o
conversation_colorize_action.cpp
color_utils.cpp: In static member function ‘static QRgb
ColorUtils::alphaBlend(const QColor&, const QColor&, qreal)’:
color_utils.cpp:102:35: error: no matching function for call to ‘qBound(double,
qreal&, double)’
     alpha = qBound(0.0, alpha, 1.0);
                                   ^
In file included from /usr/include/qt4/QtCore/qscopedpointer.h:45:0,
                 from /usr/include/qt4/QtCore/qdatastream.h:45,
                 from /usr/include/qt4/QtCore/qpair.h:45,
                 from /usr/include/qt4/QtGui/qbrush.h:45,
                 from /usr/include/qt4/QtGui/QBrush:1,
                 from color_utils.h:31,
                 from color_utils.cpp:22:
/usr/include/qt4/QtCore/qglobal.h:1330:34: note: candidate: template<class T>
const T& qBound(const T&, const T&, const T&)
 Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T
&ma
                                  ^
/usr/include/qt4/QtCore/qglobal.h:1330:34: note:   template argument
deduction/substitution failed:
color_utils.cpp:102:35: note:   deduced conflicting types for parameter ‘const
T’ (‘double’ and ‘qreal {aka float}’)
     alpha = qBound(0.0, alpha, 1.0);
                                   ^
make[2]: *** [Makefile:1812: color_utils.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory
'/var/tmp/portage/net-analyzer/wireshark-2.0.3/work/wireshark-2.0.3/ui/qt'
make[1]: *** [Makefile:3749: all-recursive] Error 1
make[1]: Leaving directory
'/var/tmp/portage/net-analyzer/wireshark-2.0.3/work/wireshark-2.0.3'
make: *** [Makefile:2358: all] Error 2


Complete build log is attached. Build was done on gentoo using its
wireshark-2.0.3 ebuild [2]. 

I found there where also others, facing this problem. [3]


After fixing this one and trying to rebuild, there was some other qreal related
error. But unfortunately I don't remember where exactly problem was, and I no
longer have that log.
Anyway, after that I created this patch (attached), which fixed the issue. Lot
of conversions, I have done there, are probably not strictly necessary in c++,
but I wanted to avoid another rebuild so I tried to make casts to qreal
everywhere, where qreal is expected. (I come from java world where these
conversion rules are stricter.)



[1] http://doc.qt.io/qt-4.8/qtglobal.html#qreal-typedef
[2] https://packages.gentoo.org/packages/net-analyzer/wireshark
[3] https://www.wireshark.org/lists/wireshark-dev/201505/msg00017.html


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