From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 31 15:30:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D971112 for ; Sat, 31 Aug 2013 15:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F6752743 for ; Sat, 31 Aug 2013 15:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r7VFU1BP059853 for ; Sat, 31 Aug 2013 15:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r7VFU1N9059852; Sat, 31 Aug 2013 15:30:01 GMT (envelope-from gnats) Resent-Date: Sat, 31 Aug 2013 15:30:01 GMT Resent-Message-Id: <201308311530.r7VFU1N9059852@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Moritz Wilhelmy Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 43BDEE70 for ; Sat, 31 Aug 2013 15:21:05 +0000 (UTC) (envelope-from root@barfooze.de) Received: from furnace.wzff.de (furnace.wzff.de [176.9.216.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 025DA2705 for ; Sat, 31 Aug 2013 15:21:05 +0000 (UTC) Received: from root by furnace.wzff.de with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VFmrz-000PMc-RP for FreeBSD-gnats-submit@freebsd.org; Sat, 31 Aug 2013 17:13:47 +0200 Message-Id: Date: Sat, 31 Aug 2013 17:13:47 +0200 From: Moritz Wilhelmy To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/181710: 9.2-RELENG kernel build with clang fails in vfs X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Moritz Wilhelmy List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2013 15:30:01 -0000 >Number: 181710 >Category: kern >Synopsis: 9.2-RELENG kernel build with clang fails in vfs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Aug 31 15:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Moritz Wilhelmy >Release: FreeBSD 9.1-RELEASE amd64 >Organization: >Environment: System: FreeBSD host.wzff.de 9.1-RELEASE FreeBSD 9.1-RELEASE #4 r246626: Sun Feb 10 22:00:34 UTC 2013 root@:/usr/obj/usr/src/sys/RCTL_ALTQ amd64 >Description: Latest 'make buildkernel' of a recently updated svn checkout (r255094) of the 9.2-RELENG branch fails with clang due to ignored return value of some VFS_* macros as follows: clang -c -O2 -pipe -fno-strict-aliasing -std=c99 -g -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 -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/kern/vfs_mountroot.c /usr/src/sys/kern/vfs_mountroot.c:270:2: error: expression result unused [-Werror,-Wunused-value] VFS_ROOT(mporoot, LK_EXCLUSIVE, &vporoot); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/sys/mount.h:727:2: note: expanded from macro 'VFS_ROOT' _rc; }) ^~~ 1 error generated. *** [vfs_mountroot.o] Error code 1 Stop in /pool/obj/usr/src/sys/GENERIC. *** [buildkernel] Error code 1 Stop in /usr/src. *** [buildkernel] Error code 1 Stop in /usr/src. >How-To-Repeat: Run "make buildkernel" using clang >Fix: Cast to (void) to explicitely ignore the return value? The patch below at least fixes my kernel build with clang, but maybe they should be cast to (void) in the macro definition instead, if the macro return value is never supposed to be used. Index: kern/vfs_mountroot.c =================================================================== --- kern/vfs_mountroot.c (revision 255094) +++ kern/vfs_mountroot.c (working copy) @@ -267,7 +267,7 @@ if (mporoot != mpdevfs) cache_purgevfs(mpdevfs); - VFS_ROOT(mporoot, LK_EXCLUSIVE, &vporoot); + (void)VFS_ROOT(mporoot, LK_EXCLUSIVE, &vporoot); VI_LOCK(vporoot); vporoot->v_iflag &= ~VI_MOUNT; Index: kern/vfs_syscalls.c =================================================================== --- kern/vfs_syscalls.c (revision 255094) +++ kern/vfs_syscalls.c (working copy) @@ -147,7 +147,7 @@ vn_start_write(NULL, &mp, V_NOWAIT) == 0) { save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); - VFS_SYNC(mp, MNT_NOWAIT); + (void)VFS_SYNC(mp, MNT_NOWAIT); curthread_pflags_restore(save); vn_finished_write(mp); } Index: ufs/ffs/ffs_softdep.c =================================================================== --- ufs/ffs/ffs_softdep.c (revision 255094) +++ ufs/ffs/ffs_softdep.c (working copy) @@ -3407,7 +3407,7 @@ if (journal_unsuspend(ump)) return; FREE_LOCK(&lk); - VFS_SYNC(mp, MNT_NOWAIT); + (void)VFS_SYNC(mp, MNT_NOWAIT); ffs_sbupdate(ump, MNT_WAIT, 0); ACQUIRE_LOCK(&lk); } >Release-Note: >Audit-Trail: >Unformatted: