simple regex compile error

I have a very simple regex program that will not compile on AIX using IBM's xlc++ compiler. Here is the program: #include <iostream> // for I/O #include <string> // for string #include <boost/regex.hpp> // for pattern matching using std::cout; using namespace std; using namespace boost; int main() { const string tmp1("abc234tree"); static const regex expression(" \\w+"); cout << regex_match(tmp1, expression) << endl; return 1; } Here is the compile statement: /usr/vacpp/bin/xlc++ -o regex regex.cpp -I /usr/local/include -lboost_filesystem-xlc-1_32 -L/usr/local/lib Here is the compiler error: "/usr/local/include/boost/regex/v4/cregex.hpp", line 75.4: 1540-0063 (S) The text "0x001" is unexpected. "/usr/local/include/boost/regex/v4/cregex.hpp", line 100.4: 1540-0063 (S) The text "0x100" is unexpected. "/usr/local/include/boost/regex/v4/cregex.hpp", line 135.3: 1540-0063 (S) The text "1" is unexpected.

I have a very simple regex program that will not compile on AIX using IBM's xlc++ compiler.
Here is the program: "/usr/local/include/boost/regex/v4/cregex.hpp", line 75.4: 1540-0063 (S) The text "0x001" is unexpected.
I believe this is a known problem: there is a fix in the works but you may have to wait a while: the problem occurs if you include the platforms native <regex.h> before including <boost/regex.hpp>, I believe in some modes IBM's compiler includes <regex.h> if you include nearly any platform header. You could try moving <boost/regex.hpp> to be the first include, if that doesn't fix it, it gets harder, because the "correct" fix is a complete restructuring of the Boost.Regex header structure. I believe that our AIX regression tests were passing for Boost.Regex so there is a set of compiler options that will also remove the problem, our regression tests are using something like: xlC -c -DNDEBUG -O3 -qstrict -qinline -qnotempinc -qfuncsect -qeh -qrtti source-file.cpp but I don't know which of those is important, Regards, John.
participants (2)
-
Brian Gaber
-
John Maddock