public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] Change this offsetof computation to use c89 offsetof. Tested:
@ 2021-08-28  0:38 Fangrui Song
  0 siblings, 0 replies; 2+ messages in thread
From: Fangrui Song @ 2021-08-28  0:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0ed6ae04d6867e588233f18791e9ad061268016c

commit 0ed6ae04d6867e588233f18791e9ad061268016c
Author: Nick Lewycky <nlewycky@google.com>
Date:   Thu Apr 16 11:15:58 2015 -0700

    Change this offsetof computation to use c89 offsetof. Tested:

Diff:
---
 socket/sys/un.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/socket/sys/un.h b/socket/sys/un.h
index 332ba0ecc7..8a3a9c7016 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [glibc/google/grte/v5-2.27/master] Change this offsetof computation to use c89 offsetof. Tested:
@ 2020-11-05 20:00 Stan Shebs
  0 siblings, 0 replies; 2+ messages in thread
From: Stan Shebs @ 2020-11-05 20:00 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2c3e3b4508c11f7364fcc9ff17f2f330d82bbb37

commit 2c3e3b4508c11f7364fcc9ff17f2f330d82bbb37
Author: Nick Lewycky <nlewycky@google.com>
Date:   Thu Apr 16 11:15:58 2015 -0700

    Change this offsetof computation to use c89 offsetof. Tested:

Diff:
---
 socket/sys/un.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/socket/sys/un.h b/socket/sys/un.h
index 332ba0ecc7..8a3a9c7016 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-28  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:38 [glibc/google/grte/v5-2.27/master] Change this offsetof computation to use c89 offsetof. Tested: Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2020-11-05 20:00 Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).