summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-17 10:58:16 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-17 10:58:16 +0000
commit8d719b57aa95b8a2baebd8fd13c6b80c2da84680 (patch)
tree13e4d5bd8f5ec8685c3764bbcb071bf99b576c75
parent546f82145e04a8f8f35c4a2a4e31787f53016fe4 (diff)
downloadpcre-8d719b57aa95b8a2baebd8fd13c6b80c2da84680.tar.gz
Comments about no_arg in the C++ wrapper.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@390 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog3
-rw-r--r--doc/pcrecpp.37
-rw-r--r--pcrecpp.h10
3 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9832dd2..b02b213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,9 @@ Version 7.9 xx-xxx-09
14. Added the non-standard REG_NOTEMPTY option to the POSIX interface.
15. Added the PCRE_NO_START_OPTIMIZE match-time option.
+
+16. Added comments and documentation about mis-use of no_arg in the C++
+ wrapper.
Version 7.8 05-Sep-08
diff --git a/doc/pcrecpp.3 b/doc/pcrecpp.3
index e52bd29..479e318 100644
--- a/doc/pcrecpp.3
+++ b/doc/pcrecpp.3
@@ -95,6 +95,11 @@ The matching interface supports at most 16 arguments per call.
If you need more, consider using the more general interface
\fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for
\fBDoMatch\fP.
+.P
+NOTE: Do not use \fBno_arg\fP, which is used internally to mark the end of a
+list of optional arguments, as a placeholder for missing arguments, as this can
+lead to segfaults.
+.
.
.SH "QUOTING METACHARACTERS"
.rs
@@ -338,5 +343,5 @@ Copyright (c) 2007 Google Inc.
.rs
.sp
.nf
-Last updated: 12 November 2007
+Last updated: 17 March 2009
.fi
diff --git a/pcrecpp.h b/pcrecpp.h
index a87a816..7e79703 100644
--- a/pcrecpp.h
+++ b/pcrecpp.h
@@ -646,9 +646,15 @@ class PCRECPP_EXP_DEFN RE {
// regexp wasn't valid on construction.
int NumberOfCapturingGroups() const;
- // The default value for an argument, to indicate no arg was passed in
+ // The default value for an argument, to indicate the end of the argument
+ // list. This must be used only in optional argument defaults. It should NOT
+ // be passed explicitly. Some people have tried to use it like this:
+ //
+ // FullMatch(x, y, &z, no_arg, &w);
+ //
+ // This is a mistake, and will not work.
static Arg no_arg;
-
+
private:
void Init(const string& pattern, const RE_Options* options);