From owner-freebsd-current@FreeBSD.ORG Tue Apr 17 19:55:50 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F8E610657DB for ; Tue, 17 Apr 2012 19:55:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id E37528FC19 for ; Tue, 17 Apr 2012 19:55:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:920:4d88:e4b9:4d05] (unknown [IPv6:2001:7b8:3a7:0:920:4d88:e4b9:4d05]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 259A25C37; Tue, 17 Apr 2012 21:55:49 +0200 (CEST) Message-ID: <4F8DCAC1.5040507@FreeBSD.org> Date: Tue, 17 Apr 2012 21:55:45 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120410 Thunderbird/12.0 MIME-Version: 1.0 To: "O. Hartmann" References: <4F8DC447.3080105@zedat.fu-berlin.de> In-Reply-To: <4F8DC447.3080105@zedat.fu-berlin.de> Content-Type: multipart/mixed; boundary="------------090206040805000401090105" Cc: Current FreeBSD Subject: 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: X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 19:55:50 -0000 This is a multi-part message in MIME format. --------------090206040805000401090105 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------090206040805000401090105 Content-Type: text/x-diff; name="clang-3.1-werror-fix-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="clang-3.1-werror-fix-1.diff" Index: sys/contrib/rdma/rdma_cma.c =================================================================== --- sys/contrib/rdma/rdma_cma.c (revision 234390) +++ sys/contrib/rdma/rdma_cma.c (working copy) @@ -1252,7 +1252,7 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, *sin = iw_event->local_addr; sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; *sin = iw_event->remote_addr; - switch (iw_event->status) { + switch ((int)iw_event->status) { case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; Index: sys/dev/dpt/dpt.h =================================================================== --- sys/dev/dpt/dpt.h (revision 234390) +++ sys/dev/dpt/dpt.h (working copy) @@ -142,7 +142,7 @@ typedef void *physaddr; */ #define DPT_NO_CACHE 0 #define DPT_CACHE_WRITETHROUGH 1 -#define DPT_CACHE_WRITEBACK -2 +#define DPT_CACHE_WRITEBACK 2 #define min(a,b) ((aifnetp; - switch(item->event_type) { + switch((int)item->event_type) { case XGE_LL_EVENT_TRY_XMIT_AGAIN: if(lldev->initialized) { if(xge_hal_channel_dtr_count(lldev->fifo_channel[0]) > 0) { Index: sys/dev/asr/asr.c =================================================================== --- sys/dev/asr/asr.c (revision 234390) +++ sys/dev/asr/asr.c (working copy) @@ -2417,8 +2417,9 @@ asr_attach(device_t dev) */ LIST_INIT(&(sc->ha_ccb)); /* Link us into the HA list */ - for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next)); - *(ha) = sc; + for (ha = &Asr_softc_list; *ha; ha = &((*ha)->ha_next)) + ; + *(ha) = sc; /* * This is the real McCoy! @@ -2700,7 +2701,7 @@ asr_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.spriv_ptr0 = sc = (struct Asr_softc *)cam_sim_softc(sim); - switch (ccb->ccb_h.func_code) { + switch ((int)ccb->ccb_h.func_code) { /* Common cases first */ case XPT_SCSI_IO: /* Execute the requested I/O operation */ --------------090206040805000401090105--