Date: Thu, 9 Oct 2014 15:26:23 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272825 - head/sys/ufs/ufs Message-ID: <201410091526.s99FQNDm042831@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Thu Oct 9 15:26:22 2014 New Revision: 272825 URL: https://svnweb.freebsd.org/changeset/base/272825 Log: Use offsetof() from sys/types.h instead of a custom one This fixes build with recent gcc versions Modified: head/sys/ufs/ufs/dir.h Modified: head/sys/ufs/ufs/dir.h ============================================================================== --- head/sys/ufs/ufs/dir.h Thu Oct 9 15:19:35 2014 (r272824) +++ head/sys/ufs/ufs/dir.h Thu Oct 9 15:26:22 2014 (r272825) @@ -110,7 +110,7 @@ struct direct { * */ #define DIRECTSIZ(namlen) \ - (((uintptr_t)&((struct direct *)0)->d_name + \ + ((offsetof(struct direct, d_name) + \ ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) #if (BYTE_ORDER == LITTLE_ENDIAN) #define DIRSIZ(oldfmt, dp) \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410091526.s99FQNDm042831>