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