From f0b05fadb5bca889457862a74b4fc990ffd93d4f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 20 Oct 2015 12:33:13 +0200 Subject: [PATCH] Fix compiler errors/warnings when compiling with -O3 * fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler warning in -O3 case. (fhandler_socket::connect): Ditto. * regex/regcomp.c (singleton): Ditto. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/fhandler_socket.cc | 4 ++-- winsup/cygwin/regex/regcomp.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d9ab9753a..d5170d730 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-09-23 Evgeny Grin + + * fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler + warning in -O3 case. + (fhandler_socket::connect): Ditto. + * regex/regcomp.c (singleton): Ditto. + 2015-08-29 Corinna Vinschen * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 9ec8e4685..bc3c610e0 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -746,7 +746,7 @@ fhandler_socket::wait_for_events (const long event_mask, const DWORD flags) return 0; int ret; - long events; + long events = 0; while (!(ret = evaluate_events (event_mask, events, !(flags & MSG_PEEK))) && !events) @@ -1159,7 +1159,7 @@ int fhandler_socket::connect (const struct sockaddr *name, int namelen) { struct sockaddr_storage sst; - int type; + int type = 0; if (get_inet_addr (name, namelen, &sst, &namelen, &type, connect_secret) == SOCKET_ERROR) diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c index d68dcc32a..554b43ae3 100644 --- a/winsup/cygwin/regex/regcomp.c +++ b/winsup/cygwin/regex/regcomp.c @@ -1246,7 +1246,7 @@ freeset(struct parse *p, cset *cs) static wint_t singleton(cset *cs) { - wint_t i, s, n; + wint_t i, s = OUT, n; for (i = n = 0; i < NC; i++) if (CHIN(cs, i)) { -- 2.43.5