[Top][All Lists]

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

[bug-gnulib] Re: bugs in regexp.c

From: Paul Eggert
Subject: [bug-gnulib] Re: bugs in regexp.c
Date: Fri, 18 Mar 2005 13:23:41 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Sam Steingold <address@hidden> writes:

> I think it is a good practice to treat undefined behavior as an
> error.

That may be, but in that case the test cases assuming a particular
extension tof POSIX, and the test cases therefore will not be portable
to all POSIX implementations.  I suspect that in some cases the
regexp.c behavior is compatible with traditional UNIX, which did not
always treat undefined behavior as an error; changing it might break
applications assuming the traditional UNIX behavior.

>        (regcomp (&r, "$*", REG_EXTENDED) != 0)

Ah, OK, I see now.  That has undefined behavior.  "$*" is a valid BRE,
but it is not a valid ERE.

defines the behavior of "*" only if it is preceded by "an ERE matching
a single character or an ERE enclosed in parentheses".  But "$" is not
such an ERE.

reply via email to

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