bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] ensure that the regexp [b-a] is diagnosed as invalid


From: Eric Blake
Subject: Re: [PATCH] ensure that the regexp [b-a] is diagnosed as invalid
Date: Wed, 3 Feb 2010 16:24:13 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> It adds a test to gl_REGEX that ensures that re_compiler_pattern
> diagnoses [b-a] as invalid when using RE_SYNTAX_POSIX_EGREP.

Where does POSIX state that this is invalid?  So far, I can only see that it is 
undefined, but have not found any hard requirements that it be a failure.

http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html

9.3.5 RE Bracket Expression, step 7: "The starting range point and the ending 
range point shall be a collating element or collating symbol.... If the 
represented set of collating elements is empty, it is unspecified whether the 
expression matches nothing, or is treated as invalid."

That said, forcing a hard failure is probably the best QoI implementation of 
undefined behavior.

-- 
Eric Blake







reply via email to

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