Author: rlibby Date: Thu Jul 6 05:32:22 2017 New Revision: 320714 URL: https://svnweb.freebsd.org/changeset/base/320714
Log: hptmv: avoid gcc variably-modified warning gcc produces a "variably modified X at file scope" warning for structures that use these size definitions. PR: 211540 Reviewed by: markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D11416 Modified: head/sys/dev/hptmv/vdevice.h Modified: head/sys/dev/hptmv/vdevice.h ============================================================================== --- head/sys/dev/hptmv/vdevice.h Thu Jul 6 05:30:11 2017 (r320713) +++ head/sys/dev/hptmv/vdevice.h Thu Jul 6 05:32:22 2017 (r320714) @@ -77,8 +77,8 @@ typedef struct _VDevice } VDevice; -#define ARRAY_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(RaidArray)) -#define DISK_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(Device)) +#define ARRAY_VDEV_SIZE (offsetof(VDevice, u) + sizeof(RaidArray)) +#define DISK_VDEV_SIZE (offsetof(VDevice, u) + sizeof(Device)) #define Map2pVDevice(pDev) ((PVDevice)((UINT_PTR)pDev - (UINT)(UINT_PTR)&((PVDevice)0)->u.disk)) _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"