stddef.h: Use a round-about cast in the definition of offsetof() to avoid warnings on machines with 64 bit addresses and when size_t is less than 64-bits.

This commit is contained in:
Gregory Nutt 2015-11-23 07:11:05 -06:00
parent 375419eaf2
commit 25ab59bf80
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@
* Reference: Opengroup.org
*/
#define offsetof(a,b) ((size_t)(&(((a *)(0))->b)))
#define offsetof(type, member) ((size_t)(uintptr_t)&(((type *)0)->member))
/****************************************************************************
* Type Definitions