Debian Bug report logs - #822708
caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous

version graph

Package: caneda; Maintainer for caneda is Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>; Source for caneda is src:caneda (PTS, buildd, popcon).

Reported by: Martin Michlmayr <tbm@hpe.com>

Date: Tue, 26 Apr 2016 18:30:15 UTC

Severity: serious

Tags: patch

Found in version caneda/0.2.0-1

Fixed in version 0.3.0-1

Done: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Tue, 26 Apr 2016 18:30:18 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Michlmayr <tbm@hpe.com>:
New Bug report received and forwarded. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Tue, 26 Apr 2016 18:30:18 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Martin Michlmayr <tbm@hpe.com>
To: submit@bugs.debian.org
Subject: caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous
Date: Tue, 26 Apr 2016 11:28:59 -0700
Package: caneda
Version: 0.2.0-1
Severity: normal
User: debian-gcc@lists.debian.org
Usertags: ftbfs-gcc-6 gcc-6-overloaded-ambiguous

This package fails to build with GCC 6.  GCC 6 has not been released
yet, but will probably come out this week.

You can find GCC 6 in unstable (gcc-6).  To build with
GCC 6, you can set CC=gcc-6 CXX=g++-6 explicitly.

You may be able to find out more about this issue at
https://gcc.gnu.org/gcc-6/changes.html

> sbuild (Debian sbuild) 0.68.0 (15 Jan 2016) on dl580gen9-02.hlinux
...
> [ 90%] Building CXX object src/CMakeFiles/caneda.dir/syntaxhighlighters.cpp.o
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src && /usr/bin/c++   -DQT_CORE_LIB -DQT_GUI_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_WIDGETS_LIB -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu -I/<<PKGBUILDDIR>>/src/dialogs -I/<<PKGBUILDDIR>>/src/paintings -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/dialogs -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/paintings -I/usr/include/qwt -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -g   -fPIC -o CMakeFiles/caneda.dir/syntaxhighlighters.cpp.o -c /<<PKGBUILDDIR>>/src/syntax
> highlighters.cpp
> /<<PKGBUILDDIR>>/src/cgraphicsscene.cpp: In member function 'void Caneda::CGraphicsScene::wiringEventMouseMove(const QPointF&)':
> /<<PKGBUILDDIR>>/src/cgraphicsscene.cpp:1214:42: error: call of overloaded 'abs(qreal)' is ambiguous

^^


>              if( abs(refPos.x()-newPos.x()) > abs(refPos.y()-newPos.y()) ) {
>                                           ^
> In file included from /usr/include/c++/6/cstdlib:75:0,
>                  from /usr/include/c++/6/bits/stl_algo.h:59,
>                  from /usr/include/c++/6/algorithm:62,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:85,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:37,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qdebug.h:37,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/QDebug:1,
>                  from /<<PKGBUILDDIR>>/src/global.h:26,
>                  from /<<PKGBUILDDIR>>/src/cgraphicsscene.h:24,
>                  from /<<PKGBUILDDIR>>/src/cgraphicsscene.cpp:22:
> /usr/include/stdlib.h:774:12: note: candidate: int abs(int)
>  extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
>             ^~~
> In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
>                  from /usr/include/c++/6/algorithm:62,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:85,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:37,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/qdebug.h:37,
>                  from /usr/include/x86_64-linux-gnu/qt5/QtCore/QDebug:1,
>                  from /<<PKGBUILDDIR>>/src/global.h:26,
>                  from /<<PKGBUILDDIR>>/src/cgraphicsscene.h:24,
>                  from /<<PKGBUILDDIR>>/src/cgraphicsscene.cpp:22:
> /usr/include/c++/6/cstdlib:185:3: note: candidate: __int128 std::abs(__int128)
>    abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
>    ^~~
> /usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
>    abs(long long __x) { return __builtin_llabs (__x); }
>    ^~~
> /usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
>    abs(long __i) { return __builtin_labs(__i); }
>    ^~~
> /<<PKGBUILDDIR>>/src/cgraphicsscene.cpp:1214:71: error: call of overloaded 'abs(qreal)' is ambiguous
>              if( abs(refPos.x()-newPos.x()) > abs(refPos.y()-newPos.y()) ) {
>                                                                        ^

-- 
Martin Michlmayr
Linux for HPE Helion, Hewlett Packard Enterprise



Information forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Wed, 27 Apr 2016 00:12:03 GMT) (full text, mbox, link).


Acknowledgement sent to "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>:
Extra info received and forwarded to list. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Wed, 27 Apr 2016 00:12:04 GMT) (full text, mbox, link).


Message #10 received at 822708@bugs.debian.org (full text, mbox, reply):

From: "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>
To: 822708@bugs.debian.org, 822708-submitter@bugs.debian.org
Subject: Re: Bug#822708: caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous
Date: Tue, 26 Apr 2016 21:09:57 -0300
[Message part 1 (text/plain, inline)]
Control: tag -1 patch

On Tuesday 26 April 2016 11:28:59 Martin Michlmayr wrote:
> Package: caneda
> Version: 0.2.0-1
> Severity: normal
> User: debian-gcc@lists.debian.org
> Usertags: ftbfs-gcc-6 gcc-6-overloaded-ambiguous
> 
> This package fails to build with GCC 6.  GCC 6 has not been released
> yet, but will probably come out this week.
[snip]
> > overloaded 'abs(qreal)' is ambiguous
> ^^
> 
> >              if( abs(refPos.x()-newPos.x()) > abs(refPos.y()-newPos.y()) )

Simply changing abs() with qAbs() will do the trick. Upstream is already 
working on it, I'll probably push a fixed version as soon as possible.

I'm afraid this will probably make a lot of code using Qt insta-RC-buggy. And 
I wonder why this is triggered.

The above code returns qreal, which is a typedef for double on all Debian 
archs in Qt5 so I still don't understand why it fails. I'll try to dig more on 
this.


-- 
If you have an apple and I have an apple and we exchange these apples then you
and I will still each have one apple. But if you have an idea and I have an
idea and we exchange these ideas, then each of us will have two ideas.
 George Bernard Shaw

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Added tag(s) patch. Request was from "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com> to 822708-submit@bugs.debian.org. (Wed, 27 Apr 2016 00:12:04 GMT) (full text, mbox, link).


Message sent on to Martin Michlmayr <tbm@hpe.com>:
Bug#822708. (Wed, 27 Apr 2016 00:12:17 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Wed, 27 Apr 2016 00:27:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>:
Extra info received and forwarded to list. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Wed, 27 Apr 2016 00:27:04 GMT) (full text, mbox, link).


Message #20 received at 822708@bugs.debian.org (full text, mbox, reply):

From: "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>
To: 822708@bugs.debian.org
Cc: 822708-submitter@bugs.debian.org
Subject: Re: Bug#822708: caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous
Date: Tue, 26 Apr 2016 21:22:24 -0300
[Message part 1 (text/plain, inline)]
Control: tag -1 moreinfo

On Tuesday 26 April 2016 21:09:57 Lisandro Damián Nicanor Pérez Meyer wrote:
[snip]
> I'm afraid this will probably make a lot of code using Qt insta-RC-buggy.
> And I wonder why this is triggered.
> 
> The above code returns qreal, which is a typedef for double on all Debian
> archs in Qt5 so I still don't understand why it fails. I'll try to dig more
> on this.

Martin: I *think* this might be a bug in gcc6.

According to [0]:

  Header <math.h> changes

  The C++ library now provides its own <math.h> header that wraps the C
  library header of the same name. The C++ header defines additional overloads
  of some functions and ensures that all standard functions are defined as
  real functions and not as macros. Code which assumes that sin, cos, pow,
  isfinite etc. are macros may no longer compile.

Now the code in question is including <cmath>. Would it be possible that cmath 
might need some adjustment? Is the only way I see this can happen at all.

[0] <https://gcc.gnu.org/gcc-6/porting_to.html#math.h>

Thanks in advance, Lisandro.

-- 
I'm doing a (free) operating system (just a hobby, won't be big and
professional like gnu) for 386(486) AT clones.
  Linus Benedict Torvalds.

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Added tag(s) moreinfo. Request was from "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com> to 822708-submit@bugs.debian.org. (Wed, 27 Apr 2016 00:27:04 GMT) (full text, mbox, link).


Message sent on to Martin Michlmayr <tbm@hpe.com>:
Bug#822708. (Wed, 27 Apr 2016 00:27:07 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Wed, 27 Apr 2016 02:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>:
Extra info received and forwarded to list. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Wed, 27 Apr 2016 02:51:04 GMT) (full text, mbox, link).


Message #30 received at 822708@bugs.debian.org (full text, mbox, reply):

From: "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>
To: 822708@bugs.debian.org
Cc: 822708-submitter@bugs.debian.org, debian-gcc@lists.debian.org
Subject: Re: Bug#822708: caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous
Date: Tue, 26 Apr 2016 23:47:08 -0300
[Message part 1 (text/plain, inline)]
On Tuesday 26 April 2016 21:22:24 Lisandro Damián Nicanor Pérez Meyer wrote:
[snip] 
> Martin: I *think* this might be a bug in gcc6.
> 
> According to [0]:
> 
>   Header <math.h> changes
> 
>   The C++ library now provides its own <math.h> header that wraps the C
>   library header of the same name. The C++ header defines additional
> overloads of some functions and ensures that all standard functions are
> defined as real functions and not as macros. Code which assumes that sin,
> cos, pow, isfinite etc. are macros may no longer compile.
> 
> Now the code in question is including <cmath>. Would it be possible that
> cmath might need some adjustment? Is the only way I see this can happen at
> all.
> 
> [0] <https://gcc.gnu.org/gcc-6/porting_to.html#math.h>

Interestingly enough if I change all the <cmath> includes with <math.h> 
everything compiles as expected. So I'm really suspecting a gcc bug here.


-- 
<rata> hmm, el enchufe hace chispas...
<-- rata ha dejado este servidor ("Leaving").
<marga> ouch
  Visto en #lugfi, irc.freenode.net

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Message sent on to Martin Michlmayr <tbm@hpe.com>:
Bug#822708. (Wed, 27 Apr 2016 02:51:06 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Wed, 27 Apr 2016 02:57:04 GMT) (full text, mbox, link).


Acknowledgement sent to "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>:
Extra info received and forwarded to list. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Wed, 27 Apr 2016 02:57:04 GMT) (full text, mbox, link).


Message #38 received at 822708@bugs.debian.org (full text, mbox, reply):

From: "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com>
To: 822708@bugs.debian.org
Cc: 822708-submitter@bugs.debian.org, debian-gcc@lists.debian.org
Subject: Re: Bug#822708: caneda: FTBFS with GCC 6: call of overloaded 'abs(qreal)' is ambiguous
Date: Tue, 26 Apr 2016 23:52:12 -0300
[Message part 1 (text/plain, inline)]
Control: tag -1 - moreinfo

On Tuesday 26 April 2016 23:47:08 Lisandro Damián Nicanor Pérez Meyer wrote:
[snip] 
> Interestingly enough if I change all the <cmath> includes with <math.h>
> everything compiles as expected. So I'm really suspecting a gcc bug here.

PEBCAK. Using cmath means the code needs to use the std:: namespace, which 
isn't. And somehow Qt seems to include math.h, so it won't be noted at compile 
time... until gcc6 :)

Sorry for the noise!

-- 
El tiempo es un buen maestro, solo que lamentablemente,
asesina a todos sus discípulos.
 Curt Goetz. (1888-1960).

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Removed tag(s) moreinfo. Request was from "Lisandro Damián Nicanor Pérez Meyer" <perezmeyer@gmail.com> to 822708-submit@bugs.debian.org. (Wed, 27 Apr 2016 02:57:04 GMT) (full text, mbox, link).


Message sent on to Martin Michlmayr <tbm@hpe.com>:
Bug#822708. (Wed, 27 Apr 2016 02:57:15 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>:
Bug#822708; Package caneda. (Tue, 14 Jun 2016 20:36:04 GMT) (full text, mbox, link).


Acknowledgement sent to Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>:
Extra info received and forwarded to list. Copy sent to Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>. (Tue, 14 Jun 2016 20:36:04 GMT) (full text, mbox, link).


Message #48 received at 822708@bugs.debian.org (full text, mbox, reply):

From: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
To: 822708@bugs.debian.org
Subject: Done
Date: Tue, 14 Jun 2016 17:33:24 -0300
[Message part 1 (text/plain, inline)]
Version: 0.3.0-1

Fixed by upstream.

-- 
The box said 'Requires Windows 95 or better'. So I installed Linux.
  Anonymous

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Severity set to 'serious' from 'normal' Request was from Matthias Klose <doko@debian.org> to control@bugs.debian.org. (Wed, 29 Jun 2016 13:13:29 GMT) (full text, mbox, link).


Reply sent to Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>:
You have taken responsibility. (Thu, 30 Jun 2016 11:51:11 GMT) (full text, mbox, link).


Notification sent to Martin Michlmayr <tbm@hpe.com>:
Bug acknowledged by developer. (Thu, 30 Jun 2016 11:51:11 GMT) (full text, mbox, link).


Message #55 received at 822708-done@bugs.debian.org (full text, mbox, reply):

From: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
To: 822708-done@bugs.debian.org
Subject: Done in the last upload
Date: Thu, 30 Jun 2016 08:48:41 -0300
[Message part 1 (text/plain, inline)]
Version: 0.3.0-1

It seems I forgot to close this bug in the last upload :)

-- 
You know you're brilliant, but maybe you'd like to understand what
you did 2 weeks from now.
  Linus Benedict Torvalds.

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
[signature.asc (application/pgp-signature, inline)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 29 Jul 2016 07:26:42 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jan 10 03:44:39 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.