git: 0076f6d1ad05 - main - sys/_offsetof.h: pacify GCC 12's macro redefinition check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Feb 2026 10:05:23 UTC
The branch main has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=0076f6d1ad05e80d372bef1caf15615cd639fb5c
commit 0076f6d1ad05e80d372bef1caf15615cd639fb5c
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-02-23 09:45:58 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-02-23 10:05:06 +0000
sys/_offsetof.h: pacify GCC 12's macro redefinition check
GCC 12 has a strict definition of identity (all characters including
whitespace must be identical) when comparing "redefined" macros. Make
our definition exactly match the stddef.h that comes with GCC to fix
test-includes of netlink/netlink_snl.h. (Note: later versions of GCC
are a bit more flexible and don't have this problem.)
Reported by: des
Sponsored by: DARPA, AFRL
Fixes: 2adc3f0db187 ("stddef.h: centralize definition of offsetof()")
---
sys/sys/_offsetof.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/sys/_offsetof.h b/sys/sys/_offsetof.h
index 25982fad774a..7a38914818a0 100644
--- a/sys/sys/_offsetof.h
+++ b/sys/sys/_offsetof.h
@@ -13,7 +13,7 @@
#define _SYS__OFFSETOF_H_
#ifndef offsetof
-#define offsetof(type, field) __builtin_offsetof(type, field)
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
#endif
#endif /* _SYS__OFFSETOF_H_ */