Define wxIsNaN() as std::isnan() in C++11 mode

Bug #1581807 reported by Benjamin Drung
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wxwidgets3.0 (Debian)
Fix Released
Unknown
wxwidgets3.0 (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

Audacity (git master) fails to build on Ubuntu 16.04 with g++ 5.3.1:

In file included from /usr/include/wx-3.0/wx/gdicmn.h:23:0,
                 from /usr/include/wx-3.0/wx/utils.h:26,
                 from BlockFile.cpp:51:
BlockFile.cpp: In function ‘void ComputeMinMax256(float*, float*, float*, int*)’:
/usr/include/wx-3.0/wx/math.h:91:31: error: ‘isnan’ was not declared in this scope
     #define wxIsNaN(x) isnan(x)
                               ^
BlockFile.cpp:325:11: note: in expansion of macro ‘wxIsNaN’
       if (wxIsNaN(summary256[3*i+2]))
           ^
/usr/include/wx-3.0/wx/math.h:91:31: note: suggested alternative:
     #define wxIsNaN(x) isnan(x)
                               ^
BlockFile.cpp:325:11: note: in expansion of macro ‘wxIsNaN’
       if (wxIsNaN(summary256[3*i+2]))
           ^
In file included from /usr/include/wx-3.0/wx/math.h:58:0,
                 from /usr/include/wx-3.0/wx/gdicmn.h:23,
                 from /usr/include/wx-3.0/wx/utils.h:26,
                 from BlockFile.cpp:51:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
     isnan(_Tp __x)
     ^
make[3]: *** [audacity-BlockFile.o] Error 1

isnan() is not defined, but std::isnan() is defined. Thus use std::isnan() for all C++11 compilers, since isnan() is part of C++11. The fix was accepted upstream: https://github.com/wxWidgets/wxWidgets/pull/283

[Test Case]

1) Create a git recipe in /tmp/bug-1581807.recipe with following content:

# git-build-recipe format 0.4 deb-version {debupstream}+git{revdate}+r{revno}+{revno:packaging}
lp:audacity f1909cb88e0fa4ecc589e715384b90d8bbfe55e6
merge packaging lp:~audacity-team/audacity/+git/packaging daily-xenial

2) Build a audacity source package:

git-build-recipe --allow-fallback-to-native /tmp/bug-1581807.recipe /tmp/audacity

3) Build the source package on xenial (for example with sbuild):

sbuild -d xenial /tmpfs/audacity_2.1.2+git20160516+r4250+17.dsc

4) You will experience the build failure described above with the unpatched wxwidgets. The build will succeed with the wxwidget patch.

[Regression Potential]

The patch changes C preprocessor definition (and not the run-time). Thus it could break source builds that use wxwidgts as library.

Benjamin Drung (bdrung)
description: updated
description: updated
Revision history for this message
Benjamin Drung (bdrung) wrote :

Attached wxwidgets3.0_3.0.2+dfsg-1.3ubuntu0.1.debdiff for SRU to xenial.

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wxwidgets3.0 - 3.0.2+dfsg-1.3ubuntu1

---------------
wxwidgets3.0 (3.0.2+dfsg-1.3ubuntu1) yakkety; urgency=medium

  * Define wxIsNaN() as std::isnan() in C++11 mode. This fixes the build
    failure of Audacity (Closes: #824264, LP: #1581807)

 -- Benjamin Drung <email address hidden> Sat, 14 May 2016 16:39:48 +0200

Changed in wxwidgets3.0 (Ubuntu):
status: New → Fix Released
Changed in wxwidgets3.0 (Debian):
status: Unknown → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Please add a proper SRU test case and regression potential to the description.

Changed in wxwidgets3.0 (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

Rejecting the upload from the xenial queue, still missing an SRU test case and explanation of regression potential as per comment #3. Can be reuploaded once this information is available, or you can ping a member of the SRU team when this is done to un-reject the package.

Changed in wxwidgets3.0 (Ubuntu Xenial):
status: New → Incomplete
Revision history for this message
Benjamin Drung (bdrung) wrote :

Sorry, I missed the requests for the SRU test case and regression potential. I added them to the description and re-uploaded the package.

description: updated
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Benjamin, or anyone else affected,

Accepted wxwidgets3.0 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wxwidgets3.0/3.0.2+dfsg-1.3ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in wxwidgets3.0 (Ubuntu Xenial):
status: Incomplete → Fix Committed
tags: added: verification-needed
Revision history for this message
Benjamin Drung (bdrung) wrote :

Ran the test case described in the description using xenial-proposed:

sbuild -d xenial --extra-repository="deb http://de.archive.ubuntu.com/ubuntu xenial-proposed main universe" audacity_$version.dsc

Build succeeded and build log says:

Setting up libwxgtk3.0-0v5:amd64 (3.0.2+dfsg-1.3ubuntu0.1) ...
Setting up wx-common (3.0.2+dfsg-1.3ubuntu0.1) ...
Setting up libwxgtk3.0-dev (3.0.2+dfsg-1.3ubuntu0.1) ...

Verification done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wxwidgets3.0 - 3.0.2+dfsg-1.3ubuntu0.1

---------------
wxwidgets3.0 (3.0.2+dfsg-1.3ubuntu0.1) xenial-proposed; urgency=medium

  * Define wxIsNaN() as std::isnan() in C++11 mode. This fixes the build
    failure of Audacity (Closes: #824264, LP: #1581807)

 -- Benjamin Drung <email address hidden> Tue, 03 Jan 2017 23:11:31 +0100

Changed in wxwidgets3.0 (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for wxwidgets3.0 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.