<div class="markdown_content"><hr />
<p><strong> <a class="alink" href="http://sourceforge.net/p/rkward/bugs/137">[bugs:#137]</a> rkward 0.6.3 fails to compile on Linux/ARM</strong></p>
<p><strong>Status:</strong> open<br />
<strong>Group:</strong> CRASH<br />
<strong>Created:</strong> Wed Mar 11, 2015 12:39 AM UTC by Tom 'spot' Callaway<br />
<strong>Last Updated:</strong> Wed Mar 11, 2015 12:39 AM UTC<br />
<strong>Owner:</strong> nobody</p>
<p>In the process of updating rkward to 0.6.3 (against R 3.1.3) in Fedora, it was discovered that 0.6.3 failed to compile on ARM. The specific failure was:</p>
<div class="codehilite"><pre><span class="err">/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp: In constructor 'RKPluginSpinBox::RKPluginSpinBox(const QDomElement&, RKComponent*, QWidget*)':</span>
<span class="o">/</span><span class="nx">builddir</span><span class="o">/</span><span class="nx">build</span><span class="o">/</span><span class="nx">BUILD</span><span class="o">/</span><span class="nx">rkward</span><span class="o">-</span><span class="mf">0.6</span><span class="p">.</span><span class="mi">3</span><span class="o">/</span><span class="nx">rkward</span><span class="o">/</span><span class="nx">plugin</span><span class="o">/</span><span class="nx">rkpluginspinbox</span><span class="p">.</span><span class="nx">cpp</span><span class="o">:</span><span class="mi">53</span><span class="o">:</span><span class="mi">97</span><span class="o">:</span> <span class="nx">error</span><span class="o">:</span> <span class="nx">no</span> <span class="nx">matching</span> <span class="kd">function</span> <span class="k">for</span> <span class="nx">call</span> <span class="nx">to</span> <span class="s1">'qMax(double&, qreal)'</span>
<span class="kr">double</span> <span class="nx">initial</span> <span class="o">=</span> <span class="nx">xml</span><span class="o">-></span><span class="nx">getDoubleAttribute</span> <span class="p">(</span><span class="nx">element</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">,</span> <span class="nx">qMin</span> <span class="p">(</span><span class="nx">max</span><span class="p">,</span> <span class="nx">qMax</span> <span class="p">(</span><span class="nx">min</span><span class="p">,</span> <span class="nx">qreal</span><span class="p">(</span><span class="mf">0.0</span><span class="p">))),</span> <span class="nx">DL_INFO</span><span class="p">);</span>
<span class="o">^</span>
<span class="err">/builddir/build/BUILD/rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp:53:97: note: candidate is:</span>
<span class="nx">In</span> <span class="nx">file</span> <span class="nx">included</span> <span class="nx">from</span> <span class="o">/</span><span class="nx">usr</span><span class="o">/</span><span class="nx">include</span><span class="o">/</span><span class="nx">QtCore</span><span class="o">/</span><span class="nx">qatomic</span><span class="p">.</span><span class="nx">h</span><span class="o">:</span><span class="mi">45</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span>
<span class="nx">from</span> <span class="o">/</span><span class="nx">usr</span><span class="o">/</span><span class="nx">include</span><span class="o">/</span><span class="nx">QtCore</span><span class="o">/</span><span class="nx">qhash</span><span class="p">.</span><span class="nx">h</span><span class="o">:</span><span class="mi">45</span><span class="p">,</span>
<span class="nx">from</span> <span class="o">/</span><span class="nx">usr</span><span class="o">/</span><span class="nx">include</span><span class="o">/</span><span class="nx">QtCore</span><span class="o">/</span><span class="nx">QHash</span><span class="o">:</span><span class="mi">1</span><span class="p">,</span>
<span class="nx">from</span> <span class="o">/</span><span class="nx">builddir</span><span class="o">/</span><span class="nx">build</span><span class="o">/</span><span class="nx">BUILD</span><span class="o">/</span><span class="nx">rkward</span><span class="o">-</span><span class="mf">0.6</span><span class="p">.</span><span class="mi">3</span><span class="o">/</span><span class="nx">rkward</span><span class="o">/</span><span class="nx">plugin</span><span class="o">/</span><span class="nx">rkcomponent</span><span class="p">.</span><span class="nx">h</span><span class="o">:</span><span class="mi">21</span><span class="p">,</span>
<span class="nx">from</span> <span class="o">/</span><span class="nx">builddir</span><span class="o">/</span><span class="nx">build</span><span class="o">/</span><span class="nx">BUILD</span><span class="o">/</span><span class="nx">rkward</span><span class="o">-</span><span class="mf">0.6</span><span class="p">.</span><span class="mi">3</span><span class="o">/</span><span class="nx">rkward</span><span class="o">/</span><span class="nx">plugin</span><span class="o">/</span><span class="nx">rkpluginspinbox</span><span class="p">.</span><span class="nx">h</span><span class="o">:</span><span class="mi">20</span><span class="p">,</span>
<span class="nx">from</span> <span class="o">/</span><span class="nx">builddir</span><span class="o">/</span><span class="nx">build</span><span class="o">/</span><span class="nx">BUILD</span><span class="o">/</span><span class="nx">rkward</span><span class="o">-</span><span class="mf">0.6</span><span class="p">.</span><span class="mi">3</span><span class="o">/</span><span class="nx">rkward</span><span class="o">/</span><span class="nx">plugin</span><span class="o">/</span><span class="nx">rkpluginspinbox</span><span class="p">.</span><span class="nx">cpp</span><span class="o">:</span><span class="mi">17</span><span class="o">:</span>
<span class="err">/usr/include/QtCore/qglobal.h:1217:34: note: template<class T> const T& qMax(const T&, const T&)</span>
<span class="nx">Q_DECL_CONSTEXPR</span> <span class="nx">inline</span> <span class="kr">const</span> <span class="nx">T</span> <span class="o">&</span><span class="nx">qMax</span><span class="p">(</span><span class="kr">const</span> <span class="nx">T</span> <span class="o">&</span><span class="nx">a</span><span class="p">,</span> <span class="kr">const</span> <span class="nx">T</span> <span class="o">&</span><span class="nx">b</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="p">(</span><span class="nx">a</span> <span class="o"><</span> <span class="nx">b</span><span class="p">)</span> <span class="o">?</span> <span class="nx">b</span> <span class="o">:</span> <span class="nx">a</span><span class="p">;</span> <span class="p">}</span>
<span class="o">^</span>
<span class="err">/usr/include/QtCore/qglobal.h:1217:34: note: template argument deduction/substitution failed:</span>
<span class="o">/</span><span class="nx">builddir</span><span class="o">/</span><span class="nx">build</span><span class="o">/</span><span class="nx">BUILD</span><span class="o">/</span><span class="nx">rkward</span><span class="o">-</span><span class="mf">0.6</span><span class="p">.</span><span class="mi">3</span><span class="o">/</span><span class="nx">rkward</span><span class="o">/</span><span class="nx">plugin</span><span class="o">/</span><span class="nx">rkpluginspinbox</span><span class="p">.</span><span class="nx">cpp</span><span class="o">:</span><span class="mi">53</span><span class="o">:</span><span class="mi">97</span><span class="o">:</span> <span class="nx">note</span><span class="o">:</span> <span class="nx">deduced</span> <span class="nx">conflicting</span> <span class="nx">types</span> <span class="k">for</span> <span class="nx">parameter</span> <span class="s1">'const T'</span> <span class="p">(</span><span class="s1">'double'</span> <span class="nx">and</span> <span class="s1">'qreal {aka float}'</span><span class="p">)</span>
<span class="kr">double</span> <span class="nx">initial</span> <span class="o">=</span> <span class="nx">xml</span><span class="o">-></span><span class="nx">getDoubleAttribute</span> <span class="p">(</span><span class="nx">element</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">,</span> <span class="nx">qMin</span> <span class="p">(</span><span class="nx">max</span><span class="p">,</span> <span class="nx">qMax</span> <span class="p">(</span><span class="nx">min</span><span class="p">,</span> <span class="nx">qreal</span><span class="p">(</span><span class="mf">0.0</span><span class="p">))),</span> <span class="nx">DL_INFO</span><span class="p">);</span>
</pre></div>
<p>This failure has been noted in other QT apps, specifically, it is the same issue noted in Debian Bug 638813: <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638813" rel="nofollow">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638813</a></p>
<p>The fix is the same, to cast the necessary parameters of qMax to a double:</p>
<div class="codehilite"><pre><span class="gh">diff -up rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp.armfix rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp</span>
<span class="gd">--- rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp.armfix 2015-03-10 19:37:12.501771989 -0400</span>
<span class="gi">+++ rkward-0.6.3/rkward/plugin/rkpluginspinbox.cpp 2015-03-10 19:37:45.131562327 -0400</span>
<span class="gu">@@ -50,7 +50,7 @@ RKPluginSpinBox::RKPluginSpinBox (const</span>
if (!intmode) {
double min = xml->getDoubleAttribute (element, "min", -FLT_MAX, DL_INFO);
double max = xml->getDoubleAttribute (element, "max", FLT_MAX, DL_INFO);
<span class="gd">- double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, qreal(0.0))), DL_INFO);</span>
<span class="gi">+ double initial = xml->getDoubleAttribute (element, "initial", qMin (max, qMax (min, double(qreal(0.0)))), DL_INFO);</span>
int default_precision = xml->getIntAttribute (element, "default_precision", 2, DL_INFO);
int max_precision = xml->getIntAttribute (element, "max_precision", 8, DL_INFO);
<span class="gh">diff -up rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp.armfix rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp</span>
<span class="gd">--- rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp.armfix 2015-03-10 20:11:02.363493214 -0400</span>
<span class="gi">+++ rkward-0.6.3/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp 2015-03-10 20:11:13.903466769 -0400</span>
<span class="gu">@@ -105,7 +105,7 @@ static QPen readSimplePen (QDataStream &</span>
instream >> lwd >> lty;
if (!col.isValid () || (lty == -1L)) return QPen (Qt::NoPen);
<span class="gd">- lwd = qMax (qreal(1.0), lwd); // minimum 1 px as in X11 device</span>
<span class="gi">+ lwd = qMax (double(qreal(1.0)), lwd); // minimum 1 px as in X11 device</span>
QPen ret;
if (lty != 0) { // solid
QVector<qreal> dashes;
</pre></div>
<p>I waive any copyright on this patch, and when that is not possible, grant permission for it to be used under the same license as the rest of RKWard.</p>
<hr />
<p>Sent from sourceforge.net because rkward-tracker@lists.sourceforge.net is subscribed to <a href="https://sourceforge.net/p/rkward/bugs">https://sourceforge.net/p/rkward/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/rkward/admin/bugs/options.">https://sourceforge.net/p/rkward/admin/bugs/options.</a> Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>