Bug 212347 - [PATCH] lang/basic256: Add patch (sent upstream) to drop 'using namespace std'
Summary: [PATCH] lang/basic256: Add patch (sent upstream) to drop 'using namespace std'
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks: 211916
  Show dependency treegraph
 
Reported: 2016-09-03 10:08 UTC by Raphael Kubo da Costa
Modified: 2016-09-04 14:19 UTC (History)
1 user (show)

See Also:
fernape: maintainer-feedback+


Attachments
Proposed patch (1.20 KB, patch)
2016-09-03 10:08 UTC, Raphael Kubo da Costa
rakuco: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa freebsd_committer 2016-09-03 10:08:03 UTC
The attached patch (a smaller version of one I've sent upstream) removes 'using namespace std' from Interpreter.cpp to avoid errors when -std=c++11 or -std=gnu++11 is passed to the compiler, as a call to bind(2) can end up becoming a call to std::bind().

This is required to avoid breaking the build with Qt 5.6.1:

> c++ -c -O2 -pipe -fstack-protector -fno-strict-aliasing -g -std=gnu++11 -pthread -D_THREAD_SAFE -Wall -W -fPIC -DLINUX -DESPEAK -DSOUND_QMOBILITY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/local/include/espeak -I/usr/local/include/qt5/QtMultimedia -I/usr/local/include/qt5/QtSerialPort -IQtMobility -IQtMobility -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -Itmp/moc -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o tmp/obj/Interpreter.o Interpreter.cpp
> Interpreter.cpp:4282:105: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int')
Comment 1 Raphael Kubo da Costa freebsd_committer 2016-09-03 10:08:50 UTC
Created attachment 174331 [details]
Proposed patch
Comment 2 Fernando Apesteguía freebsd_committer 2016-09-04 13:40:30 UTC
The patch looks good to me.

FWIW, with qt-5.5.1

- QA
  * portlint -AC: OK
  * port test: OK
  * poudriere builds {9.3,10.1,10.2,10.3}{i386,amd64}: OK

Thanks a lot!
Comment 3 commit-hook freebsd_committer 2016-09-04 14:19:21 UTC
A commit references this bug:

Author: rakuco
Date: Sun Sep  4 14:18:59 UTC 2016
New revision: 421339
URL: https://svnweb.freebsd.org/changeset/ports/421339

Log:
  Add patch (sent upstream) to drop `using namespace std'

  This patch is a smaller version of one I've sent upstream. It removes 'using
  namespace std' from Interpreter.cpp to avoid errors when -std=c++11 or
  -std=gnu++11 is passed to the compiler, as a call to bind(2) can end up
  becoming a call to std::bind().

  This is required to avoid breaking the build with Qt 5.6.1:

    c++ -c -O2 -pipe -fstack-protector -fno-strict-aliasing -g -std=gnu++11 -pthread -D_THREAD_SAFE -Wall -W -fPIC -DLINUX -DESPEAK -DSOUND_QMOBILITY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I/usr/local/include/espeak -I/usr/local/include/qt5/QtMultimedia -I/usr/local/include/qt5/QtSerialPort -IQtMobility -IQtMobility -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -Itmp/moc -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o tmp/obj/Interpreter.o Interpreter.cpp
    Interpreter.cpp:4282:105: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int')

  PR:		212347
  Approved by:	fernando.apesteguia@gmail.com (maintainer)

Changes:
  head/lang/basic256/files/patch-Interpreter.cpp
Comment 4 Raphael Kubo da Costa freebsd_committer 2016-09-04 14:19:58 UTC
Thanks for the review!