From owner-freebsd-current@FreeBSD.ORG Tue Nov 6 16:39:30 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 236F8CD9 for ; Tue, 6 Nov 2012 16:39:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw14.york.ac.uk (mail-gw14.york.ac.uk [144.32.129.164]) by mx1.freebsd.org (Postfix) with ESMTP id D53FE8FC14 for ; Tue, 6 Nov 2012 16:39:29 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:47635) by mail-gw14.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TVmBK-00084e-HC; Tue, 06 Nov 2012 16:39:18 +0000 Date: Tue, 6 Nov 2012 16:39:18 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@thunderhorn.york.ac.uk To: Niclas Zeising Subject: Re: lsof vs. clang In-Reply-To: <50991B47.2060409@daemonic.se> Message-ID: References: <50991B47.2060409@daemonic.se> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-current@freebsd.org, Larry Rosenman X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Nov 2012 16:39:30 -0000 On Tue, 6 Nov 2012, Niclas Zeising wrote: > On 11/06/12 14:42, Larry Rosenman wrote: > > It appears that we've (mostly) cleaned up the clang/system interface > > such that sysutils/lsof works with cc as clang. > > > > Can someone tell me what we need to do to shut these up? > > > > > > # LSOFCC=cc CC=cc make LSOFCC=cc CC=cc > > ===> lsof-4.87.a,7 depends on file: /usr/local/sbin/pkg - found > > ===> Extracting for lsof-4.87.a,7 > > => SHA256 Checksum OK for lsof_4.87A.freebsd.tar.bz2. > > ===> Patching for lsof-4.87.a,7 > > ===> Configuring for lsof-4.87.a,7 > > Creating ./lockf_owner.h from /usr/src/sys/kern/kern_lockf.c > > ./lockf_owner.h creation succeeded. > > rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c > > dstore.c dzfs.h kernelbase.h machine.h machine.h.old new_machine.h > > __lseek.s Makefile Makefile.zfs ./tests/config.cflags > > rm -f ./tests/config.cc ./tests/config.xobj ./tests/config.ldflags > > Testing C library for localtime() and strftime(), using cc ... present > > ln -s dialects/freebsd/dlsof.h dlsof.h > > ln -s dialects/freebsd/dmnt.c dmnt.c > > ln -s dialects/freebsd/dnode.c dnode.c > > ln -s dialects/freebsd/dnode1.c dnode1.c > > ln -s dialects/freebsd/dnode2.c dnode2.c > > ln -s dialects/freebsd/dproc.c dproc.c > > ln -s dialects/freebsd/dproto.h dproto.h > > ln -s dialects/freebsd/dsock.c dsock.c > > ln -s dialects/freebsd/dstore.c dstore.c > > ln -s dialects/freebsd/dzfs.h dzfs.h > > ln -s dialects/freebsd/machine.h machine.h > > Makefile and lib/Makefile created. > > Makefile.zfs created. > > ./tests/config.cc created > > ./tests/config.cflags created > > ./tests/config.ldflags created > > ./tests/config.xobj created > > ===> Building for lsof-4.87.a,7 > > (cd lib; make DEBUG="-O2" CFGF="-pipe -fno-omit-frame-pointer > > -fno-strict-aliasing -fno-omit-frame-pointer -DHASEFFNLINK=i_effnlink > > -DHASF_VNODE -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 > > -DHAS_VM_MEMATTR_T -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H > > -DHAS_ZFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB > > -DNEEDS_BOOLEAN_T -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS > > -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME > > -DLSOF_VSTR=\"10.0-CURRENT\"") > > cc -pipe -fno-omit-frame-pointer -fno-strict-aliasing > > -fno-omit-frame-pointer -DHASEFFNLINK=i_effnlink -DHASF_VNODE > > -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T > > -DHAS_CDEV2PRIV -DHAS_NO_SI_UDEV -DHAS_SYS_SX_H -DHAS_ZFS -DHAS_V_LOCKF > > -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T > > -DFREEBSDV=10000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 > > -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR="10.0-CURRENT" -I/usr/src/sys -O2 > > -c ckkv.c > > In file included from ckkv.c:43: > > In file included from ./../lsof.h:195: > > In file included from ./../dlsof.h:190: > > In file included from /usr/src/sys/ufs/ufs/ufsmount.h:36: > > /usr/src/sys/sys/buf.h:392:2: warning: implicit declaration of function > > 'KASSERT' is invalid in C99 [-Wimplicit-function-declaration] > > KASSERT(bp->b_bufobj != NULL, ("bwrite: no bufobj bp=%p", bp)); > > ^ > As this hints on, KASSERT is undeclared. You should either declare KASSERT > manually or include the proper header file. > With that said, KASSERT look very much like kernel code, and should probably > not be used in userland utilities at all, but I am no expert on this. Yes, probalby either #include sys/systm.h, or it may be easier to roll your own #define inside lsof.h: #define KASSERT(exp,msg) do {} while (0) Given this is userland code, you probably don't want the true KASSERT code anyway. Gavin