System headers with clang?
Larry Rosenman
ler at lerctr.org
Sun Oct 9 17:32:49 UTC 2011
I had gotten a PR about sysutils/lsof not compiling with clang. I had
Vic Abell check it out, and the problem is NOT with lsof per se, but
with the system headers.
Is there a project afoot to update the system headers to make them clang
compilable?
Output below.
=========================================================================================
(cd lib; make DEBUG="-O2" CFGF="-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=9000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME
-DLSOF_VSTR=\"9.0-BETA3\"")
clang -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=9000 -DHASFDESCFS=2 -DHASPSEUDOFS -DHASNULLFS -DHASIPv6 -DHASUTMPX -DHAS_STRFTIME -DLSOF_VSTR="9.0-BETA3" -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:388: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));
^
/usr/src/sys/sys/buf.h:388:33: warning: expression result unused [-Wunused-value]
KASSERT(bp->b_bufobj != NULL, ("bwrite: no bufobj bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/buf.h:389:41: warning: expression result unused [-Wunused-value]
KASSERT(bp->b_bufobj->bo_ops != NULL, ("bwrite: no bo_ops bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/buf.h:391:7: warning: expression result unused [-Wunused-value]
("bwrite: no bop_write bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/buf.h:399:33: warning: expression result unused [-Wunused-value]
KASSERT(bp->b_bufobj != NULL, ("bstrategy: no bufobj bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/buf.h:401:7: warning: expression result unused [-Wunused-value]
("bstrategy: no bo_ops bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/buf.h:403:7: warning: expression result unused [-Wunused-value]
("bstrategy: no bop_strategy bp=%p", bp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ckkv.c:43:
In file included from ./../lsof.h:195:
In file included from ./../dlsof.h:432:
In file included from /usr/include/string.h:45:
/usr/include/strings.h:47:6: error: conflicting types for '__builtin_ffs'
int ffs(int) __pure2;
^
/usr/include/machine/cpufunc.h:140:24: note: expanded from:
#define ffs(x) __builtin_ffs(x)
^
/usr/include/strings.h:47:6: note: '__builtin_ffs' is a builtin with type 'int (unsigned int)'
7 warnings and 1 error generated.
*** Error code 1
Stop in /usr/home/abe/src/lsof485d/lib.
*** Error code 1
Stop in /usr/home/abe/src/lsof485d.
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: ler at lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893
More information about the freebsd-current
mailing list