From: Nick Lewycky Date: Thu, 16 Apr 2015 18:15:58 +0000 (-0700) Subject: Change this offsetof computation to use c89 offsetof. Tested: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ed6ae04d6867e588233f18791e9ad061268016c;p=thirdparty%2Fglibc.git Change this offsetof computation to use c89 offsetof. Tested: --- diff --git a/socket/sys/un.h b/socket/sys/un.h index 332ba0ecc79..8a3a9c7016c 100644 --- a/socket/sys/un.h +++ b/socket/sys/un.h @@ -40,7 +40,7 @@ struct sockaddr_un #ifdef __USE_MISC /* Evaluate to actual length of the `sockaddr_un' structure. */ -# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ +# define SUN_LEN(ptr) (offsetof(struct sockaddr_un, sun_path) \ + strlen ((ptr)->sun_path)) #endif