[Pcre-svn] [390] code/trunk: Comments about no_arg in the C+…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [390] code/trunk: Comments about no_arg in the C++ wrapper.
Revision: 390
          http://vcs.pcre.org/viewvc?view=rev&revision=390
Author:   ph10
Date:     2009-03-17 10:58:16 +0000 (Tue, 17 Mar 2009)


Log Message:
-----------
Comments about no_arg in the C++ wrapper.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/doc/pcrecpp.3
    code/trunk/pcrecpp.h


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2009-03-15 18:24:05 UTC (rev 389)
+++ code/trunk/ChangeLog    2009-03-17 10:58:16 UTC (rev 390)
@@ -56,6 +56,9 @@
 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

Modified: code/trunk/doc/pcrecpp.3
===================================================================
--- code/trunk/doc/pcrecpp.3    2009-03-15 18:24:05 UTC (rev 389)
+++ code/trunk/doc/pcrecpp.3    2009-03-17 10:58:16 UTC (rev 390)
@@ -95,7 +95,12 @@
 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
 .sp
@@ -338,5 +343,5 @@
 .rs
 .sp
 .nf
-Last updated: 12 November 2007
+Last updated: 17 March 2009
 .fi


Modified: code/trunk/pcrecpp.h
===================================================================
--- code/trunk/pcrecpp.h    2009-03-15 18:24:05 UTC (rev 389)
+++ code/trunk/pcrecpp.h    2009-03-17 10:58:16 UTC (rev 390)
@@ -646,9 +646,15 @@
   // 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);