public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14632] New: regcomp function does not return 0 for invalid regular expression
@ 2004-03-18 14:45 jas at cs dot yorku dot ca
  2004-03-18 15:11 ` [Bug c/14632] " bangerth at dealii dot org
  0 siblings, 1 reply; 2+ messages in thread
From: jas at cs dot yorku dot ca @ 2004-03-18 14:45 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/14632] regcomp function does not return 0 for invalid regular expression
  2004-03-18 14:45 [Bug c/14632] New: regcomp function does not return 0 for invalid regular expression jas at cs dot yorku dot ca
@ 2004-03-18 15:11 ` bangerth at dealii dot org
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth at dealii dot org @ 2004-03-18 15:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-18 15:11 -------
Unfortunately, regex is not under the control of gcc. You will have to find 
the authors of that package and report this with them. 
 
Thanks 
  Wolfgang 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14632


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-18 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-18 14:45 [Bug c/14632] New: regcomp function does not return 0 for invalid regular expression jas at cs dot yorku dot ca
2004-03-18 15:11 ` [Bug c/14632] " bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).