public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Change this offsetof computation to use c89 offsetof. Tested:
@ 2021-08-28 0:33 Fangrui Song
0 siblings, 0 replies; 4+ messages in thread
From: Fangrui Song @ 2021-08-28 0:33 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] 4+ messages in thread
* [glibc/maskray/grte] Change this offsetof computation to use c89 offsetof. Tested:
@ 2021-08-28 0:29 Fangrui Song
0 siblings, 0 replies; 4+ messages in thread
From: Fangrui Song @ 2021-08-28 0:29 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fb242fabd1f0535bad2e0beff4102f6e5e77e46b
commit fb242fabd1f0535bad2e0beff4102f6e5e77e46b
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] 4+ messages in thread
* [glibc/maskray/grte] Change this offsetof computation to use c89 offsetof. Tested:
@ 2021-08-27 23:48 Fangrui Song
0 siblings, 0 replies; 4+ messages in thread
From: Fangrui Song @ 2021-08-27 23:48 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d0d5f283240a5dad2f89e9d181f2dd7362429329
commit d0d5f283240a5dad2f89e9d181f2dd7362429329
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] 4+ messages in thread
* [glibc/maskray/grte] Change this offsetof computation to use c89 offsetof. Tested:
@ 2021-08-27 23:46 Fangrui Song
0 siblings, 0 replies; 4+ messages in thread
From: Fangrui Song @ 2021-08-27 23:46 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=09319a15f475a4e15625af9287a250be5e873494
commit 09319a15f475a4e15625af9287a250be5e873494
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] 4+ messages in thread
end of thread, other threads:[~2021-08-28 0:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 0:33 [glibc/maskray/grte] Change this offsetof computation to use c89 offsetof. Tested: Fangrui Song
-- strict thread matches above, loose matches on Subject: below --
2021-08-28 0:29 Fangrui Song
2021-08-27 23:48 Fangrui Song
2021-08-27 23:46 Fangrui Song
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).