Opened 9 years ago

Closed 8 years ago

#9879 closed Bugs (fixed)

compiler_status fails to compile in C++98 mode

Reported by: Arfrever.FTA@… Owned by: René Rivera
Milestone: Boost 1.56.0 Component: Regression Testing USE GITHUB
Version: Boost 1.55.0 Severity: Regression
Keywords: Cc: Arfrever.FTA@…

Description

compiler_status fails to compile in C++98 mode (which is default in GCC). This problem is a regression introduced in Boost 1.55.0. This problem is absent in older versions of Boost (e.g. 1.54.0). I use GCC 4.8.2.

gcc.compile.c++ regression/build/bin/gcc-4.8/gentoorelease/boost.locale.icu-off/link-static/pch-off/threading-multi/compiler_status.o

    "x86_64-pc-linux-gnu-g++"  -ftemplate-depth-128 -march=core2 -O2 -fno-ident -frecord-gcc-switches -pipe -Wall -finline-functions -Wno-inline -Wall -pthread  -DBOOST_ALL_NO_LIB=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I".." -c -o "regression/build/bin/gcc-4.8/gentoorelease/boost.locale.icu-off/link-static/pch-off/threading-multi/compiler_status.o" "regression/src/compiler_status.cpp"

regression/src/compiler_status.cpp: In function ‘std::string {anonymous}::revision(const boost::filesystem::path&)’:
regression/src/compiler_status.cpp:131:15: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
           for(auto itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
               ^
regression/src/compiler_status.cpp:131:20: error: ‘itr’ does not name a type
           for(auto itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
                    ^
regression/src/compiler_status.cpp:131:41: error: expected ‘;’ before ‘itr’
           for(auto itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
                                         ^
regression/src/compiler_status.cpp:131:41: error: ‘itr’ was not declared in this scope
regression/src/compiler_status.cpp: In function ‘int cpp_main(int, char**)’:
regression/src/compiler_status.cpp:1017:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
   if (jamfile_path.empty())
      ^
In file included from ../boost/filesystem/path_traits.hpp:23:0,
                 from ../boost/filesystem/path.hpp:25,
                 from ../boost/filesystem/operations.hpp:25,
                 from regression/src/compiler_status.cpp:29:
../boost/system/error_code.hpp: At global scope:
../boost/system/error_code.hpp:222:36: warning: ‘boost::system::posix_category’ defined but not used [-Wunused-variable]
     static const error_category &  posix_category = generic_category();
                                    ^
../boost/system/error_code.hpp:223:36: warning: ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable]
     static const error_category &  errno_ecat     = generic_category();
                                    ^
../boost/system/error_code.hpp:224:36: warning: ‘boost::system::native_ecat’ defined but not used [-Wunused-variable]
     static const error_category &  native_ecat    = system_category();
                                    ^
...skipped <pregression/build/bin/gcc-4.8/gentoorelease/boost.locale.icu-off/link-static/pch-off/threading-multi>compiler_status for lack of <pregression/build/bin/gcc-4.8/gentoorelease/boost.locale.icu-off/link-static/pch-off/threading-multi>compiler_status.o...
...failed updating 1 target...

Change History (3)

comment:1 by Arfrever.FTA@…, 9 years ago

Potential fix:

--- tools/regression/src/compiler_status.cpp
+++ tools/regression/src/compiler_status.cpp
@@ -128,7 +128,7 @@
         string ln(line);
         if (ln.find("Revision: ") != string::npos)
         {
-          for(auto itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
+          for(string::iterator itr = ln.begin()+10; itr != ln.end() && isdigit(*itr); ++itr)
             rev += *itr;
         }
       }

comment:2 by viboes, 9 years ago

Component: NoneRegression Testing
Owner: set to René Rivera

comment:3 by René Rivera, 8 years ago

Resolution: fixed
Status: newclosed

This is obsolete code now that we are using GIT. The new working code that compiles with C++98 is on the develop branch of the boostorg/regression repo. The old code will soon totally disappear soon.

Note: See TracTickets for help on using tickets.