Author Topic: yatebts 6.0.0 multuple compilation errors  (Read 7593 times)

spina

  • Newbie
  • *
  • Posts: 6
    • View Profile
yatebts 6.0.0 multuple compilation errors
« on: July 23, 2018, 07:00:10 AM »
Compiling latest yatebts releases (from SVN or tarball) fail with multiple errors related to c++ std streams manipulation.

For example:
MSInfo.cpp: In member function ‘bool GPRS::MSInfo::msAssignChannels()’:
MSInfo.cpp:641:86: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’})
             GPRSLOG(INFO,GPRS_MSG|GPRS_CHECK_OK) << "Multislot assignment for "<<this<<os;
MSInfo.cpp:641:86: note: candidate: ‘operator<<(int, int)’ <built-in>
MSInfo.cpp:641:86: note:   no known conversion for argument 2 from ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’} to ‘int’

AFAIK, this does not relate to invalid/missing dependencies, but rather to plain incorrect C++.

My build tool chain is:
Linux 4.17.6
GCC 8.1.1
libstdc++ 3.3.6

Thanks you for taking care of this issue.

spina

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: yatebts 6.0.0 multuple compilation errors
« Reply #1 on: July 23, 2018, 08:08:48 AM »
Actually, there are only a few compilation errors, I previously thought there were more because my console output was flooded by GCC diagnostics/candidates.

The patch bellow fix the compilation errors. I haven't tested the built yatebts yet, though. 


Index: mbts/GPRS/MSInfo.cpp
===================================================================
--- mbts/GPRS/MSInfo.cpp   (revision 666)
+++ mbts/GPRS/MSInfo.cpp   (working copy)
@@ -638,7 +638,7 @@
         if (msPCHDowns.size() > 1) {
             std::ostringstream os;
             msDumpChannels(os);
-            GPRSLOG(INFO,GPRS_MSG|GPRS_CHECK_OK) << "Multislot assignment for "<<this<<os;
+            GPRSLOG(INFO,GPRS_MSG|GPRS_CHECK_OK) << "Multislot assignment for "<<this<<os.str();
         }
 
    } else {
Index: mbts/SGSNGGSN/Sgsn.cpp
===================================================================
--- mbts/SGSNGGSN/Sgsn.cpp   (revision 666)
+++ mbts/SGSNGGSN/Sgsn.cpp   (working copy)
@@ -149,7 +149,7 @@
    clearConn(GprsConnNone,SigConnLost);
    std::ostringstream ss;
    sgsnInfoDump(this,ss);
-   SGSNLOGF(INFO,GPRS_OK|GPRS_MSG,"SGSN","Removing SgsnInfo:"<<ss);
+   SGSNLOGF(INFO,GPRS_OK|GPRS_MSG,"SGSN","Removing SgsnInfo:"<<ss.str());
    sSgsnInfoList.remove(this);
    GmmInfo *gmm = getGmm();
    if (gmm && (gmm->getSI() == this)) {
@@ -253,7 +253,7 @@
 {
    std::ostringstream ss;
    gmmInfoDump(gmm,ss,0);
-   SGSNLOGF(INFO,GPRS_OK|GPRS_MSG,"SGSN","Removing gmm:"<<ss);
+   SGSNLOGF(INFO,GPRS_OK|GPRS_MSG,"SGSN","Removing gmm:"<<ss.str());
    SgsnInfo *si;
    RN_FOR_ALL(SgsnInfoList_t,sSgsnInfoList,si) {
       // The second test here should be redundant.