You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Ferenc Gerlits (Jira)" <ji...@apache.org> on 2020/05/26 09:30:00 UTC
[jira] [Created] (MINIFICPP-1239) Use STL regular expressions
whenever we can
Ferenc Gerlits created MINIFICPP-1239:
-----------------------------------------
Summary: Use STL regular expressions whenever we can
Key: MINIFICPP-1239
URL: https://issues.apache.org/jira/browse/MINIFICPP-1239
Project: Apache NiFi MiNiFi C++
Issue Type: Improvement
Reporter: Ferenc Gerlits
Assignee: Ferenc Gerlits
Fix For: 0.8.0
Because gcc < 4.9 has only partial and buggy support for regular expressions (see [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631]), we need to use the more basic regex functions of regex.h when using those old compilers. In RegexUtils.h, this is done using the condition
{code:c++}
#if (__cplusplus > 201103L) || defined(_WIN32)
// use STL regexes
{code}
However, this means that we only use the STL regexes on Windows, because on Linux and MacOS we compile with {{-std=c++11}} (and not 14), so {{__cplusplus}} is always set to {{201103}}.
Change the condition to use STL regexes by default, and only fall back to regex.h in the case of old gcc compilers, i.e.
{code:c++}
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9))
// don't use STL regexes
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)