This is from attempting to build for amd64 via amd64-gcc instead of clang 3.8.0. --- all_subdir_hptmv --- In file included from /usr/src/sys/dev/hptmv/global.h:197:0, from /usr/src/sys/modules/hptmv/../../dev/hptmv/mv.c:42: /usr/src/sys/dev/hptmv/vdevice.h:145:2: error: variably modified '_ArrayTables' at file scope [-Werror] BYTE _ArrayTables[MAX_ARRAY_PER_VBUS * ARRAY_VDEV_SIZE]; ^ . . . --- entry.o --- In file included from /usr/src/sys/dev/hptmv/global.h:197:0, from /usr/src/sys/modules/hptmv/../../dev/hptmv/entry.c:54: /usr/src/sys/dev/hptmv/vdevice.h:145:2: error: variably modified '_ArrayTables' at file scope [-Werror] BYTE _ArrayTables[MAX_ARRAY_PER_VBUS * ARRAY_VDEV_SIZE]; ^ . . . --- all_subdir_hptmv --- /usr/src/sys/modules/hptmv/../../dev/hptmv/entry.c: In function 'hpt_poll': /usr/src/sys/modules/hptmv/../../dev/hptmv/entry.c:2091:17: warning: variable 'pAdapter' set but not used [-Wunused-but-set-variable] IAL_ADAPTER_T *pAdapter; ^ cc1: all warnings being treated as errors Context: # uname -apKU FreeBSD FreeBSDx64 11.0-BETA3 FreeBSD 11.0-BETA3 #2 r303691M: Tue Aug 2 23:40:42 PDT 2016 markmi@FreeBSDx64:/usr/obj/clang/amd64.amd64/usr/src/sys/GENERIC-NODBG amd64 amd64 1100120 1100120
(In reply to Mark Millard from comment #0) Now reproduced in trying to build 11.0-BETA4 -r303759. But there is no 11.0-BETA4 Version selection available yet. So use 11.0-BETA3 selection for now. The "variably modified '_ArrayTables' at file scope" messages refer to (various .h files contributing): #define MAX_VDEVICE_PER_VBUS 8 . . . #ifndef MAX_ARRAY_PER_VBUS #define MAX_ARRAY_PER_VBUS (MAX_VDEVICE_PER_VBUS*2) /* worst case */ #endif . . . #define ARRAY_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(RaidArray)) . . . typedef struct _VBus { . . . #ifdef SUPPORT_ARRAY PVDevice pFreeArrayLink; BYTE _ArrayTables[MAX_ARRAY_PER_VBUS * ARRAY_VDEV_SIZE]; #endif . . . } VBus; ARRAY_VDEV_SIZE is what is being complained about for its use in typedef struct _VBus at file scope.
A commit references this bug: Author: rlibby Date: Thu Jul 6 05:32:22 UTC 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 Changes: head/sys/dev/hptmv/vdevice.h
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved. Thanks