Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the code to use PCRE2 instead of the deprecated PCRE3, ensuring compatibility with the trixie image build.
- Updated build flags in Makefile.am files (tests and src) to use PCRE2.
- Replaced PCRE3-specific header and API usage with PCRE2 in source files.
- Updated debian/control and configure.ac to use the PCRE2 development libraries.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Makefile.am | Updated compiler/linker flags to use PCRE2. |
| src/ipaddrcheck_functions.h | Replaced pcre.h with pcre2.h and defined code unit width. |
| src/ipaddrcheck_functions.c | Updated API calls from PCRE3 to PCRE2. |
| src/Makefile.am | Updated linking flags to use PCRE2 libraries. |
| debian/control | Changed build dependencies from PCRE3 to PCRE2. |
| configure.ac | Removed PCRE3 header check and added PCRE2 module. |
| rc = pcre_exec(re, NULL, str, strlen(str), 0, 0, offsets, 1); | ||
| pcre2_match_data *match = pcre2_match_data_create_from_pattern(re, NULL); | ||
|
|
||
| rc = pcre2_match(re, (PCRE2_SPTR)str, strlen(str), 0, 0, match, NULL); |
There was a problem hiding this comment.
Consider casting the result of strlen(str) to PCRE2_SIZE (e.g., (PCRE2_SIZE)strlen(str)) to match the expected type for the length parameter in pcre2_match.
Suggested change
| rc = pcre2_match(re, (PCRE2_SPTR)str, strlen(str), 0, 0, match, NULL); | |
| rc = pcre2_match(re, (PCRE2_SPTR)str, (PCRE2_SIZE)strlen(str), 0, 0, match, NULL); |
dmbaturin
approved these changes
Jun 23, 2025
Member
dmbaturin
left a comment
There was a problem hiding this comment.
It builds and passes all tests, so I have no objections. We certainly have no choice but to upgrade to PCRE2 everywhere if we plan to base the next big release on Trixie.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
PCRE3 is deprecated, use PCRE2.
Required for trixie image build.
Types of changes
Related Task(s)
Related PR(s)
Proposed changes
How to test
Checklist: