usr/src/sys/modules/nxge/../../dev/nxge/if_nxge.c:1289:11: error: case value not in enumerated type 'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch], case XGE_LL_EVENT_DEVICE_RESETTING:

Dimitry Andric dim at FreeBSD.org
Tue Apr 17 19:55:50 UTC 2012


On 2012-04-17 21:28, O. Hartmann wrote:
> Compiling the most recent kernel sources results in the following error.
> OS is:
>
> FreeBSD 10.0-CURRENT #3 r234326: Mon Apr 16 00:47:35 CEST 2012
>
> ===>  nxge (all)
> clang -O2 -fno-strict-aliasing -pipe -pipe -O3 -fno-strict-aliasing
> -march=native -DXGE_DEBUG_MODULE_MASK=XGE_COMPONENT_LL
> -DXGE_DEBUG_ERR_MASK=XGE_COMPONENT_LL -Werror -D_KERNEL -DKLD_MODULE
> -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include
> /usr/obj/usr/src/sys/THOR/opt_global.h -I. -I@ -I@/contrib/altq
> -fno-common  -fno-omit-frame-pointer -I/usr/obj/usr/src/sys/THOR
> -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse
> -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding
> -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector
> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
> -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs
> -fdiagnostics-show-option  -Wno-error-tautological-compare
> -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-self-assign
> -c /usr/src/sys/modules/nxge/../../dev/nxge/if_nxge.c
> /usr/src/sys/modules/nxge/../../dev/nxge/if_nxge.c:1276:11: error: case
> value not in enumerated type 'xge_hal_event_e' (aka 'enum
> xge_hal_event_e') [-Werror,-Wswitch]
>              case XGE_LL_EVENT_TRY_XMIT_AGAIN:
>                   ^
> /usr/src/sys/modules/nxge/../../dev/nxge/if_nxge.c:1289:11: error: case
> value not in enumerated type 'xge_hal_event_e' (aka 'enum
> xge_hal_event_e') [-Werror,-Wswitch]
>              case XGE_LL_EVENT_DEVICE_RESETTING:
>                   ^

Yes, this is expected.  I imported a new clang snapshot, which has more
elaborate checks on switches in combinations with enums.

There are several other problems like this, the fixes are in the
pipeline.  But for the fix for this particular error in nxge, I didn't
yet receive enough feedback.

For now, please set WERROR= in your src.conf, or apply the attached
patch to your source tree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-3.1-werror-fix-1.diff
Type: text/x-diff
Size: 2241 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20120417/ae7f3e09/clang-3.1-werror-fix-1.bin


More information about the freebsd-current mailing list