Skip to content

fixed #10610 - added support for PCRE2#8382

Draft
firewave wants to merge 2 commits intocppcheck-opensource:mainfrom
firewave:regex-pcre2-x
Draft

fixed #10610 - added support for PCRE2#8382
firewave wants to merge 2 commits intocppcheck-opensource:mainfrom
firewave:regex-pcre2-x

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave firewave changed the title added support for PCRE2 / added engine to rule XML to specify regex engine fixed #10610 - added support for PCRE2 Mar 27, 2026
Comment thread cmake/findDependencies.cmake Outdated
@@ -32,7 +32,13 @@ if(HAVE_RULES)
find_path(PCRE_INCLUDE pcre.h)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need pcre.h if you are using pcre2.h ? I'm trying to build with CMake on Debian Trixie, for which libpcre3-dev is not available, and the build still fails because CMake cannot detect pcre.h

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need pcre.h if you are using pcre2.h ?

No.

This is still WIP. I have not added build options separating PCRE from PCRE2 yet.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 7, 2026

@Harvester57
Copy link
Copy Markdown

Looking almost good with cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=ON -DUSE_PCRE2=ON -DDISABLE_PCRE1=ON : https://github.com/Harvester57/docker-cppcheck/actions/runs/24076359858/job/70225683963 👍

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Apr 7, 2026

almost good

Hence it still being a draft. 🙂

@loqs
Copy link
Copy Markdown

loqs commented May 4, 2026

@firewave do you need any help completing this pull request? I can open pull requests against your branch to complete adding support for PCRE2 and address the issues I have found so far.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented May 4, 2026

@firewave do you need any help completing this pull request? I can open pull requests against your branch to complete adding support for PCRE2 and address the issues I have found so far.

@loqs Thanks, but all the implementation work is done.

The main issue is how to proceed with the deprecation/transition steps for PCRE to a new default. I had an idea on how to proceed but since std::regex has always been hot garbage (and is also currently being broken in Visual Studio 2022) the steps are not that obvious anymore and I am currently not in the space of mind of thinking it through properly. It is definitely a multi-step process. Another annoyance is to cover the steps in the CI.

@loqs
Copy link
Copy Markdown

loqs commented May 4, 2026

@loqs Thanks, but all the implementation work is done.

So all the following is fixed but not pushed yet?:

  • Building with only PCRE1
  • Building with only PCRE2
  • Memory leak of PCRE2 match
  • Return values not checked in PCRE2 code path
  • PCRE2 handling of capture groups does not match PCRE1
  • Mismatched test expectations
  • Missing CI integration
  • Missing Makefile integration
  • Missing documentation

Should Arch Linux just disable rules for now in order to be able to drop PCRE1 or will this pull request be merged before a transition to something other than PCRE2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants