[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] getaddrinfo-tests: port --enable-gcc-warnings to clang
From: |
Paul Eggert |
Subject: |
[PATCH 3/4] getaddrinfo-tests: port --enable-gcc-warnings to clang |
Date: |
Wed, 15 May 2013 20:53:39 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
ChangeLog | 4 ++++
tests/test-getaddrinfo.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fbd47fc..f9212fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2013-05-15 Paul Eggert <address@hidden>
+ getaddrinfo-tests: port --enable-gcc-warnings to clang
+ * tests/test-getaddrinfo.c (simple):
+ Avoid casts from looser to stricter-aligned pointers.
+
thread: port --enable-gcc-warnings to clang
* lib/glthread/thread.h [__clang__ && USE_POSIX_THREADS_WEAK]:
Include <signal.h>, to pacify a warning about pthread_sigmask.
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index 1b9892f..5c27d3b 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -114,6 +114,8 @@ simple (char const *host, char const *service)
for (ai = ai0; ai; ai = ai->ai_next)
{
+ void *ai_addr = ai->ai_addr;
+ struct sockaddr_in *sock_addr = ai_addr;
dbgprintf ("\tflags %x\n", ai->ai_flags);
dbgprintf ("\tfamily %x\n", ai->ai_family);
dbgprintf ("\tsocktype %x\n", ai->ai_socktype);
@@ -121,8 +123,7 @@ simple (char const *host, char const *service)
dbgprintf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
dbgprintf ("\tFound %s\n",
inet_ntop (ai->ai_family,
- &((struct sockaddr_in *)
- ai->ai_addr)->sin_addr,
+ &sock_addr->sin_addr,
buf, sizeof (buf) - 1));
if (ai->ai_canonname)
dbgprintf ("\tFound %s...\n", ai->ai_canonname);
--
1.7.11.7
- [PATCH 4/8] mbsstr: port --enable-gcc-warnings to clang, (continued)
- [PATCH 4/8] mbsstr: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 5/8] memchr2: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 6/8] obstack: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 7/8] sig2str: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Eric Blake, 2013/05/15
- Re: [PATCH 8/8] stdio: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Paul Eggert, 2013/05/15
- Re: [PATCH 1/4] stdio: use __REDIRECT for fwrite, fwrite_unlocked, Eric Blake, 2013/05/16
- [PATCH 2/4] thread: port --enable-gcc-warnings to clang, Paul Eggert, 2013/05/15
- [PATCH 3/4] getaddrinfo-tests: port --enable-gcc-warnings to clang,
Paul Eggert <=
- [PATCH 4/4] spawn-tests, sys_socket-tests, sys_wait-tests: port to clang, Paul Eggert, 2013/05/15