Details

[Home]

Issue of the Standard # S0557

Brief

Lack of details in the description of error code REG_BADRPT

Detailed Description

The description of the regcomp() function does not clearly define when REG_BADRPT must be returned. Error code description: REG_BADRPT '?', '*', or '+' not preceded by valid regular expression. The description of error REG_BADRPT can be interpreted in several ways (see examples). Examples: 1) In the examples below the regular expression preceding the ‘*’ is not valid but the other than REG_BADRPT error code can be returned: • (a\{2,1\})* • )* • (()a* 2) In the examples below the regular expression preceding the ‘*’ is valid but the addition of the ‘*’ makes it invalid: • initial regular expression “a*” is valid, but “a**” is invalid • initial regular expression “a\{3,4\}” is valid, but “a\{3,4\}*” is invalid It is not clear in which of those cases REG_BADRPT error code must be returned: either in none of them or in both or in some them or in some other cases.

Problem location(s) in the standard

The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition (SUS 3.0), Chapter 9. Regular Expressions, the description of the regcomp() function.

Possible solutions

Define clearly when REG_BADRPT must be returned.

[Home]