diff options
author | Philip Hazel <Philip.Hazel@gmail.com> | 2023-12-02 17:09:31 +0000 |
---|---|---|
committer | Philip Hazel <Philip.Hazel@gmail.com> | 2023-12-02 17:09:31 +0000 |
commit | 014c82d7bcc2873cdb1f3abc5e5348587f477ba4 (patch) | |
tree | 88cf849a1267eebec1c0ee34698ff77ac7c58b41 | |
parent | afce00e484cff118a824dac498e8044680dac401 (diff) | |
download | pcre-014c82d7bcc2873cdb1f3abc5e5348587f477ba4.tar.gz |
Fix data type anomaly in pcre2_substring_list_free()prototype
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | doc/html/pcre2_substring_list_free.html | 2 | ||||
-rw-r--r-- | doc/html/pcre2api.html | 6 | ||||
-rw-r--r-- | doc/pcre2.txt | 8 | ||||
-rw-r--r-- | doc/pcre2_substring_list_free.3 | 4 | ||||
-rw-r--r-- | doc/pcre2api.3 | 8 | ||||
-rw-r--r-- | doc/pcre2demo.3 | 2 | ||||
-rw-r--r-- | src/pcre2.h.in | 2 | ||||
-rw-r--r-- | src/pcre2_substring.c | 4 | ||||
-rw-r--r-- | src/pcre2test.c | 16 |
10 files changed, 33 insertions, 26 deletions
@@ -206,6 +206,13 @@ maximum of 65535 is now silently applied. 5. Merged @carenas patch #175 which fixes #86 - segfault on aarch64 (ARM), +6. The prototype for pcre2_substring_list_free() specified its argument as +PCRE2_SPTR * which is a const data type, whereas the yield from +pcre2_substring_list() is not const. This caused compiler warnings. I have +changed the argument of pcre2_substring_list_free() to be PCRE2_UCHAR ** to +remove this anomaly. This might cause new warnings in existing code where a +cast has been used to avoid previous ones. + Version 10.41 06-December-2022 ------------------------------ diff --git a/doc/html/pcre2_substring_list_free.html b/doc/html/pcre2_substring_list_free.html index 0919d1e5..dea8bc58 100644 --- a/doc/html/pcre2_substring_list_free.html +++ b/doc/html/pcre2_substring_list_free.html @@ -19,7 +19,7 @@ SYNOPSIS <b>#include <pcre2.h></b> </P> <P> -<b>void pcre2_substring_list_free(PCRE2_SPTR *<i>list</i>);</b> +<b>void pcre2_substring_list_free(PCRE2_UCHAR **<i>list</i>);</b> </P> <br><b> DESCRIPTION diff --git a/doc/html/pcre2api.html b/doc/html/pcre2api.html index 39b6c368..3e59a80b 100644 --- a/doc/html/pcre2api.html +++ b/doc/html/pcre2api.html @@ -253,7 +253,7 @@ document for an overview of all the PCRE2 documentation. <b> PCRE2_SPTR <i>name</i>);</b> <br> <br> -<b>void pcre2_substring_list_free(PCRE2_SPTR *<i>list</i>);</b> +<b>void pcre2_substring_list_free(PCRE2_UCHAR **<i>list</i>);</b> <br> <br> <b>int pcre2_substring_list_get(pcre2_match_data *<i>match_data</i>,</b> @@ -3413,7 +3413,7 @@ capturing slots, substring number 1 is unset. <b>" PCRE2_UCHAR ***<i>listptr</i>, PCRE2_SIZE **<i>lengthsptr</i>);</b> <br> <br> -<b>void pcre2_substring_list_free(PCRE2_SPTR *<i>list</i>);</b> +<b>void pcre2_substring_list_free(PCRE2_UCHAR **<i>list</i>);</b> </P> <P> The <b>pcre2_substring_list_get()</b> function extracts all available substrings @@ -4140,7 +4140,7 @@ Cambridge, England. </P> <br><a name="SEC43" href="#TOC1">REVISION</a><br> <P> -Last updated: 14 November 2023 +Last updated: 02 December 2023 <br> Copyright © 1997-2023 University of Cambridge. <br> diff --git a/doc/pcre2.txt b/doc/pcre2.txt index bee12b8b..2c7758fc 100644 --- a/doc/pcre2.txt +++ b/doc/pcre2.txt @@ -357,7 +357,7 @@ PCRE2 NATIVE API STRING EXTRACTION FUNCTIONS int pcre2_substring_number_from_name(const pcre2_code *code, PCRE2_SPTR name); - void pcre2_substring_list_free(PCRE2_SPTR *list); + void pcre2_substring_list_free(PCRE2_UCHAR **list); int pcre2_substring_list_get(pcre2_match_data *match_data, PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); @@ -3307,7 +3307,7 @@ EXTRACTING A LIST OF ALL CAPTURED SUBSTRINGS int pcre2_substring_list_get(pcre2_match_data *match_data, PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); - void pcre2_substring_list_free(PCRE2_SPTR *list); + void pcre2_substring_list_free(PCRE2_UCHAR **list); The pcre2_substring_list_get() function extracts all available sub- strings and builds a list of pointers to them. It also (optionally) @@ -3977,11 +3977,11 @@ AUTHOR REVISION - Last updated: 14 November 2023 + Last updated: 02 December 2023 Copyright (c) 1997-2023 University of Cambridge. -PCRE2 10.43 14 November 2023 PCRE2API(3) +PCRE2 10.43 02 December 2023 PCRE2API(3) ------------------------------------------------------------------------------ diff --git a/doc/pcre2_substring_list_free.3 b/doc/pcre2_substring_list_free.3 index d977ed52..2c6fb02c 100644 --- a/doc/pcre2_substring_list_free.3 +++ b/doc/pcre2_substring_list_free.3 @@ -1,4 +1,4 @@ -.TH PCRE2_SUBSTRING_LIST_FREE 3 "28 June 2018" "PCRE2 10.32" +.TH PCRE2_SUBSTRING_LIST_FREE 3 "02 December 2023" "PCRE2 10.43" .SH NAME PCRE2 - Perl-compatible regular expressions (revised API) .SH SYNOPSIS @@ -7,7 +7,7 @@ PCRE2 - Perl-compatible regular expressions (revised API) .B #include <pcre2.h> .PP .SM -.B void pcre2_substring_list_free(PCRE2_SPTR *\fIlist\fP); +.B void pcre2_substring_list_free(PCRE2_UCHAR **\fIlist\fP); . .SH DESCRIPTION .rs diff --git a/doc/pcre2api.3 b/doc/pcre2api.3 index a6115d93..e4e1a9e1 100644 --- a/doc/pcre2api.3 +++ b/doc/pcre2api.3 @@ -1,4 +1,4 @@ -.TH PCRE2API 3 "14 November 2023" "PCRE2 10.43" +.TH PCRE2API 3 "02 December 2023" "PCRE2 10.43" .SH NAME PCRE2 - Perl-compatible regular expressions (revised API) .sp @@ -181,7 +181,7 @@ document for an overview of all the PCRE2 documentation. .B int pcre2_substring_number_from_name(const pcre2_code *\fIcode\fP, .B " PCRE2_SPTR \fIname\fP);" .sp -.B void pcre2_substring_list_free(PCRE2_SPTR *\fIlist\fP); +.B void pcre2_substring_list_free(PCRE2_UCHAR **\fIlist\fP); .sp .B int pcre2_substring_list_get(pcre2_match_data *\fImatch_data\fP, .B " PCRE2_UCHAR ***\fIlistptr\fP, PCRE2_SIZE **\fIlengthsptr\fP); @@ -3430,7 +3430,7 @@ capturing slots, substring number 1 is unset. .B int pcre2_substring_list_get(pcre2_match_data *\fImatch_data\fP, .B " PCRE2_UCHAR ***\fIlistptr\fP, PCRE2_SIZE **\fIlengthsptr\fP); .sp -.B void pcre2_substring_list_free(PCRE2_SPTR *\fIlist\fP); +.B void pcre2_substring_list_free(PCRE2_UCHAR **\fIlist\fP); .fi .P The \fBpcre2_substring_list_get()\fP function extracts all available substrings @@ -4148,6 +4148,6 @@ Cambridge, England. .rs .sp .nf -Last updated: 14 November 2023 +Last updated: 02 December 2023 Copyright (c) 1997-2023 University of Cambridge. .fi diff --git a/doc/pcre2demo.3 b/doc/pcre2demo.3 index b134dda3..006fcbc7 100644 --- a/doc/pcre2demo.3 +++ b/doc/pcre2demo.3 @@ -1,4 +1,4 @@ -.TH PCRE2DEMO 3 "30 November 2023" "PCRE2 10.43-DEV" +.TH PCRE2DEMO 3 " 2 December 2023" "PCRE2 10.43-DEV" .\"AUTOMATICALLY GENERATED BY PrepareRelease - do not EDIT! .SH NAME // - A demonstration C program for PCRE2 - // diff --git a/src/pcre2.h.in b/src/pcre2.h.in index 1ebe68f3..3ba7e867 100644 --- a/src/pcre2.h.in +++ b/src/pcre2.h.in @@ -733,7 +733,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ - pcre2_substring_list_free(PCRE2_SPTR *); \ + pcre2_substring_list_free(PCRE2_UCHAR **); \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); diff --git a/src/pcre2_substring.c b/src/pcre2_substring.c index a8d3e390..14e919dc 100644 --- a/src/pcre2_substring.c +++ b/src/pcre2_substring.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2018 University of Cambridge + New API code Copyright (c) 2016-2023 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -445,7 +445,7 @@ Returns: nothing */ PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION -pcre2_substring_list_free(PCRE2_SPTR *list) +pcre2_substring_list_free(PCRE2_UCHAR **list) { if (list != NULL) { diff --git a/src/pcre2test.c b/src/pcre2test.c index 7ba70301..c016aa92 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -1545,11 +1545,11 @@ are supported. */ #define PCRE2_SUBSTRING_LIST_FREE(a) \ if (test_mode == PCRE8_MODE) \ - pcre2_substring_list_free_8((PCRE2_SPTR8 *)a); \ + pcre2_substring_list_free_8((PCRE2_UCHAR8 **)a); \ else if (test_mode == PCRE16_MODE) \ - pcre2_substring_list_free_16((PCRE2_SPTR16 *)a); \ + pcre2_substring_list_free_16((PCRE2_UCHAR16 **)a); \ else \ - pcre2_substring_list_free_32((PCRE2_SPTR32 *)a) + pcre2_substring_list_free_32((PCRE2_UCHAR32 **)a) #define PCRE2_SUBSTRING_NUMBER_FROM_NAME(a,b,c) \ if (test_mode == PCRE8_MODE) \ @@ -2034,9 +2034,9 @@ the three different cases. */ #define PCRE2_SUBSTRING_LIST_FREE(a) \ if (test_mode == G(G(PCRE,BITONE),_MODE)) \ - G(pcre2_substring_list_free_,BITONE)((G(PCRE2_SPTR,BITONE) *)a); \ + G(pcre2_substring_list_free_,BITONE)((G(PCRE2_UCHAR,BITONE) **)a); \ else \ - G(pcre2_substring_list_free_,BITTWO)((G(PCRE2_SPTR,BITTWO) *)a) + G(pcre2_substring_list_free_,BITTWO)((G(PCRE2_UCHAR,BITTWO) **)a) #define PCRE2_SUBSTRING_NUMBER_FROM_NAME(a,b,c) \ if (test_mode == G(G(PCRE,BITONE),_MODE)) \ @@ -2191,7 +2191,7 @@ the three different cases. */ #define PCRE2_SUBSTRING_LIST_GET(a,b,c,d) \ a = pcre2_substring_list_get_8(G(b,8),(PCRE2_UCHAR8 ***)c,d) #define PCRE2_SUBSTRING_LIST_FREE(a) \ - pcre2_substring_list_free_8((PCRE2_SPTR8 *)a) + pcre2_substring_list_free_8((PCRE2_UCHAR8 **)a) #define PCRE2_SUBSTRING_NUMBER_FROM_NAME(a,b,c) \ a = pcre2_substring_number_from_name_8(G(b,8),G(c,8)); #define PTR(x) (void *)G(x,8) @@ -2300,7 +2300,7 @@ the three different cases. */ #define PCRE2_SUBSTRING_LIST_GET(a,b,c,d) \ a = pcre2_substring_list_get_16(G(b,16),(PCRE2_UCHAR16 ***)c,d) #define PCRE2_SUBSTRING_LIST_FREE(a) \ - pcre2_substring_list_free_16((PCRE2_SPTR16 *)a) + pcre2_substring_list_free_16((PCRE2_UCHAR16 **)a) #define PCRE2_SUBSTRING_NUMBER_FROM_NAME(a,b,c) \ a = pcre2_substring_number_from_name_16(G(b,16),G(c,16)); #define PTR(x) (void *)G(x,16) @@ -2409,7 +2409,7 @@ the three different cases. */ #define PCRE2_SUBSTRING_LIST_GET(a,b,c,d) \ a = pcre2_substring_list_get_32(G(b,32),(PCRE2_UCHAR32 ***)c,d) #define PCRE2_SUBSTRING_LIST_FREE(a) \ - pcre2_substring_list_free_32((PCRE2_SPTR32 *)a) + pcre2_substring_list_free_32((PCRE2_UCHAR32 **)a) #define PCRE2_SUBSTRING_NUMBER_FROM_NAME(a,b,c) \ a = pcre2_substring_number_from_name_32(G(b,32),G(c,32)); #define PTR(x) (void *)G(x,32) |