mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
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:
parent
5215f072af
commit
412b476b7f
@ -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 */
|
/* 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
|
#ifndef __attribute
|
||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
|
Loading…
Reference in New Issue
Block a user