Re: 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:

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 17 Apr 2012 21:55:45 +0200
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_at_ -I_at_/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.

Received on Tue Apr 17 2012 - 17:55:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:26 UTC