[Bug c/14632] New: regcomp function does not return 0 for invalid regular expression
jas at cs dot yorku dot ca
gcc-bugzilla@gcc.gnu.org
Thu Mar 18 14:45:00 GMT 2004
A few tests using regcomp indicate that it is not returning 0 for an invalid
regular expression. For example:
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
main()
{
regex_t re;
int x;
x = regcomp(&re, "(", 0);
printf("%d\n",x);
}
Run this, x is 0.
if I set the regexp to "*", x is 0 (the man page describes the error code
REG_BADRPT as "Invalid use of repetition operators such as using `*' as the
first character.)
if I set the regexp to "**" or even "((", x is 0.
In fact, I can't input a regular expression that has x return anything other than 0.
Comments?
--
Summary: regcomp function does not return 0 for invalid regular
expression
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jas at cs dot yorku dot ca
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14632
More information about the Gcc-bugs
mailing list