Mercurial > dovecot > core-2.2
changeset 4018:989dd95aa8b9 HEAD
Enable -Wstrict-aliasing=2 warning and fixed a couple of warnings it gave.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 14 Feb 2006 20:28:15 +0200 |
parents | e2d267e6f930 |
children | 19dad76ef68d |
files | configure.in src/lib/fd-close-on-exec.c src/lib/network.c |
diffstat | 3 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.in Tue Feb 14 19:43:04 2006 +0200 +++ b/configure.in Tue Feb 14 20:28:15 2006 +0200 @@ -311,7 +311,7 @@ # -Wcast-qual -Wcast-align -Wconversion # too many warnings # -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems # -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings - CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast" + CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wstrict-aliasing=2" # Use std=gnu99 if we have new enough gcc old_cflags=$CFLAGS
--- a/src/lib/fd-close-on-exec.c Tue Feb 14 19:43:04 2006 +0200 +++ b/src/lib/fd-close-on-exec.c Tue Feb 14 20:28:15 2006 +0200 @@ -37,8 +37,7 @@ struct sockaddr_un sa; socklen_t socklen = sizeof(sa); - if (getsockname(first_fd, - (struct sockaddr *) &sa, + if (getsockname(first_fd, (void *)&sa, &socklen) < 0) sa.sun_path[0] = '\0';
--- a/src/lib/network.c Tue Feb 14 19:43:04 2006 +0200 +++ b/src/lib/network.c Tue Feb 14 20:28:15 2006 +0200 @@ -181,7 +181,7 @@ net_set_nonblock(fd, TRUE); /* connect */ - ret = connect(fd, (struct sockaddr *) &sa, sizeof(sa)); + ret = connect(fd, (void *)&sa, sizeof(sa)); if (ret < 0 && errno != EINPROGRESS) { close_keep_errno(fd); return -1; @@ -324,7 +324,7 @@ } /* bind */ - if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) { + if (bind(fd, (void *)&sa, sizeof(sa)) < 0) { if (errno != EADDRINUSE) i_error("bind(%s) failed: %m", path); } else { @@ -498,7 +498,7 @@ i_assert(fd >= 0); addrlen = sizeof(so); - if (getsockname(fd, (struct sockaddr *) &so, &addrlen) == -1) + if (getsockname(fd, &so.sa, &addrlen) == -1) return -1; if (addr != NULL) sin_get_ip(&so, addr); @@ -515,7 +515,7 @@ i_assert(fd >= 0); addrlen = sizeof(so); - if (getpeername(fd, (struct sockaddr *) &so, &addrlen) == -1) + if (getpeername(fd, &so.sa, &addrlen) == -1) return -1; if (addr != NULL) sin_get_ip(&so, addr);