From 6cef93abd55ce6e3bb87c11056f89b9df3ff0fb3 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 27 Sep 2002 01:08:05 +0000 Subject: [PATCH] * socket-utils.h (sa2sin, sa2sin6): Add redundant cast to (void *) to get GCC to shut up about alignment increasing. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14901 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 5 +++++ src/include/socket-utils.h | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index a043700c7..e341f23c6 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,8 @@ +2002-09-26 Tom Yu + + * socket-utils.h (sa2sin, sa2sin6): Add redundant cast to (void *) + to get GCC to shut up about alignment increasing. + 2002-09-19 Ken Raeburn * port-sockets.h: Include sys/filio.h if available. diff --git a/src/include/socket-utils.h b/src/include/socket-utils.h index 9ee94d9cb..c16a22db8 100644 --- a/src/include/socket-utils.h +++ b/src/include/socket-utils.h @@ -71,19 +71,24 @@ struct krb5int_sockaddr_storage { #endif #if defined (__GNUC__) -/* There's a lot of confusion between pointers to different sockaddr - types, and pointers with different degrees of indirection, as in - the locate_kdc type functions. Use these function to ensure we - don't do something silly like cast a "sockaddr **" to a - "sockaddr_in *". */ +/* + * There's a lot of confusion between pointers to different sockaddr + * types, and pointers with different degrees of indirection, as in + * the locate_kdc type functions. Use these function to ensure we + * don't do something silly like cast a "sockaddr **" to a + * "sockaddr_in *". + * + * The casts to (void *) are to get GCC to shut up about alignment + * increasing. + */ static __inline__ struct sockaddr_in *sa2sin (struct sockaddr *sa) { - return (struct sockaddr_in *) sa; + return (struct sockaddr_in *) (void *) sa; } #ifdef KRB5_USE_INET6 static __inline__ struct sockaddr_in6 *sa2sin6 (struct sockaddr *sa) { - return (struct sockaddr_in6 *) sa; + return (struct sockaddr_in6 *) (void *) sa; } #endif static __inline__ struct sockaddr *ss2sa (struct sockaddr_storage *ss) -- 2.26.2