From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30054 invoked by alias); 18 Mar 2004 14:45:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30040 invoked by uid 48); 18 Mar 2004 14:45:20 -0000 Date: Thu, 18 Mar 2004 14:45:00 -0000 From: "jas at cs dot yorku dot ca" To: gcc-bugs@gcc.gnu.org Message-ID: <20040318144512.14632.jas@cs.yorku.ca> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/14632] New: regcomp function does not return 0 for invalid regular expression X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg02199.txt.bz2 List-Id: A few tests using regcomp indicate that it is not returning 0 for an invalid regular expression. For example: #include #include #include 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