Believe it or not, it appears to be a bug in the C++ runtime. Anyone who
wants to prove me wrong is welcome to try the below. I have tested only on
z/OS V2R2.
#include <stdio.h>
#define __IBMCPP_TR1__ 1
#include <regex>
class myRegex
{
public:
std::tr1::regex regexObject;
};
int main(int argc, char* argv[])
{
printf("RegEx test 4/6/2018\n");
std::tr1::regex::flag_type flags = std::tr1::regex::extended; //
necessary for error
myRegex *myRegex_p = new myRegex;
myRegex_p->regexObject.assign("foo", flags);
delete myRegex_p;
return 0;
}
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Charles Mills
Sent: Friday, April 6, 2018 6:00 PM
To: [email protected]
Subject: Any C++ regex template class gotchas?
X-posted to IBM-MAIN and MVS-OE. (The latter seems more appropriate but the
former has more traffic by far.)
I'm trying to use the C++ template class regex for the first time. I have
code that works without any hint of an error on Windows but I am getting a
S0C4 on z/OS when the destructor calls some routine in the LE runtime
library. I've put in typical debugging checks for storage overlays with no
hint of an error.
Anyone know of any particular gotchas relative to the regex class for z/OS
C++?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN