From 6e3f2c626d965a8de228372b819fc65f0ba6da64 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 4 Feb 2010 21:05:07 +0000 Subject: [PATCH] * regcomp.c (p_ere): Workaround incorrect compiler warning. * regerror.c (regatoi): Return non-const string or compiler complains in certain inexplicable situations. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/regex/regcomp.c | 4 ++-- winsup/cygwin/regex/regerror.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0d28a5b97..4b26c9aee 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2010-02-04 Christopher Faylor + + * regcomp.c (p_ere): Workaround incorrect compiler warning. + * regerror.c (regatoi): Return non-const string or compiler complains + in certain inexplicable situations. + 2010-02-04 Corinna Vinschen * regex/engine.c (step): Declare and define with `int ch' rather than diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c index 5bcaa98c3..721982ab1 100644 --- a/winsup/cygwin/regex/regcomp.c +++ b/winsup/cygwin/regex/regcomp.c @@ -315,8 +315,8 @@ p_ere(struct parse *p, int stop) /* character this ERE should end at */ { char c; - sopno prevback; - sopno prevfwd; + sopno prevback = 0; + sopno prevfwd = 0; sopno conc; int first = 1; /* is this the first alternative? */ diff --git a/winsup/cygwin/regex/regerror.c b/winsup/cygwin/regex/regerror.c index 7e88be5cb..1bba3e4a6 100644 --- a/winsup/cygwin/regex/regerror.c +++ b/winsup/cygwin/regex/regerror.c @@ -178,7 +178,7 @@ regatoi(const regex_t *preg, char *localbuf) if (r->code == 0) #ifdef __CYGWIN__ /* Avoid whining compiler */ { - static const char null[] = "0"; + static char null[] = "0"; return null; } #else -- 2.43.5