summaryrefslogtreecommitdiff
path: root/lib-src/pop.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-05-17 22:32:17 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-05-17 22:32:17 -0700
commit31ff141c226d00ce8c85562e7812ff1178cb45ed (patch)
tree129202655e89622c0ea695d2993e9134990d29bd /lib-src/pop.c
parentbfbe26276d04b1e8aeaec21fea7573ac1135d521 (diff)
Port --enable-gcc-warnings to clang.
* configure.ac (nw): Remove obsolescent warnings. These aren't needed for clang, or for gcc for that matter. (emacs_cv_clang): New var, which tests for clang. Omit warnings that clang is too picky about. (GLIB_DISABLE_DEPRECATION_WARNINGS): Define this; needed for Ubuntu 13.04 + clang + --enable-gcc-warnings. * lib-src/etags.c: Omit unnecessary forward decls. (print_version, print_help): Declare _Noreturn. * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify. * src/bytecode.c (exec_byte_code): * src/regex.c: Redo diagnostic pragmas to pacify clang, too. * src/dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable. * src/editfns.c (Fencode_time): * src/fileio.c (file_accessible_directory_p): * src/font.c (font_unparse_xlfd): Use '&"string"[index]' instead of '"string" + (index)'. * src/undo.c (user_error): Remove; unused.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r--lib-src/pop.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 1f3f82baa6..a269144c91 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1075,28 +1075,22 @@ socket_connection (char *host, int flags)
}
} while (ret != 0);
- if (ret == 0)
- {
- it = res;
- while (it)
- {
- if (it->ai_addrlen == sizeof (addr))
- {
- struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
- addr.sin_addr = in_a->sin_addr;
- if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
- break;
- }
- it = it->ai_next;
- }
- connect_ok = it != NULL;
- if (connect_ok)
- {
- realhost = alloca (strlen (it->ai_canonname) + 1);
- strcpy (realhost, it->ai_canonname);
- }
- freeaddrinfo (res);
+ for (it = res; it; it = it->ai_next)
+ if (it->ai_addrlen == sizeof addr)
+ {
+ struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
+ addr.sin_addr = in_a->sin_addr;
+ if (! connect (sock, (struct sockaddr *) &addr, sizeof addr))
+ break;
+ }
+ connect_ok = it != NULL;
+ if (connect_ok)
+ {
+ realhost = alloca (strlen (it->ai_canonname) + 1);
+ strcpy (realhost, it->ai_canonname);
}
+ freeaddrinfo (res);
+
#else /* !HAVE_GETADDRINFO */
do
{