bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comment update in regex.h for RE_DUP_MAX


From: Paul Eggert
Subject: comment update in regex.h for RE_DUP_MAX
Date: Thu, 13 Apr 2006 15:18:21 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I installed this:

2006-04-13  Paul Eggert  <address@hidden>

        * lib/regex.h (RE_DUP_MAX): Update comment to match current
        implementation.

--- lib/regex.h 10 Apr 2006 06:43:33 -0000      1.36
+++ lib/regex.h 13 Apr 2006 22:14:12 -0000      1.37
@@ -322,7 +322,14 @@ extern reg_syntax_t re_syntax_options;
 # ifdef RE_DUP_MAX
 #  undef RE_DUP_MAX
 # endif
-/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows.  */
+
+/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
+   the counter as a 2-byte signed integer.  This is no longer true, so
+   RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
+   ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined.
+   However, there would be a huge performance problem if someone
+   actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
+   its historical value.  */
 # define RE_DUP_MAX (0x7fff)
 
 #endif /* defined __USE_GNU_REGEX */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]