Fix #79172: STRUCT_OFFSET() relies on undefined behavior

Since this pattern is understood by compilers, not a real issue, but
certainly cleaner this way.
This commit is contained in:
Christoph M. Becker 2020-01-28 09:15:23 +01:00
parent 5215f072af
commit 412b476b7f

View File

@ -15,7 +15,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
/* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */
#define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
#define STRUCT_OFFSET(t, f) XtOffsetOf(t, f)
#ifndef __attribute
#if !defined(__GNUC__)