Disable several instances instances of clang's -Wself-assign warning.

All of these are harmless, and are in fact used to shut up warnings from
lint.

While here, remove -Wno-missing-prototypes from the xfs module
Makefile, as I could not reproduce those warnings either with gcc or
clang.

MFC after:	1 week
This commit is contained in:
dim 2011-12-30 13:16:59 +00:00
parent bf1efdbdcd
commit a15eaa46ba
5 changed files with 38 additions and 17 deletions

View File

@ -304,7 +304,7 @@ contrib/dev/acpica/utilities/utxface.c optional acpi
contrib/dev/acpica/utilities/utxferror.c optional acpi
#contrib/dev/acpica/utilities/utxfmutex.c optional acpi
contrib/ipfilter/netinet/fil.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \
@ -316,11 +316,11 @@ contrib/ipfilter/netinet/ip_log.c optional ipfilter inet \
contrib/ipfilter/netinet/ip_nat.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_proxy.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_state.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \
compile-with "${NORMAL_C} -Wno-error -I$S/contrib/ipfilter"
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-error -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \
@ -1522,17 +1522,25 @@ dev/ncv/ncr53c500.c optional ncv
dev/ncv/ncr53c500_pccard.c optional ncv pccard
dev/netmap/netmap.c optional netmap
dev/nge/if_nge.c optional nge
dev/nxge/if_nxge.c optional nxge
dev/nxge/xgehal/xgehal-device.c optional nxge
dev/nxge/if_nxge.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-device.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-mm.c optional nxge
dev/nxge/xgehal/xge-queue.c optional nxge
dev/nxge/xgehal/xgehal-driver.c optional nxge
dev/nxge/xgehal/xgehal-ring.c optional nxge
dev/nxge/xgehal/xgehal-channel.c optional nxge
dev/nxge/xgehal/xgehal-fifo.c optional nxge
dev/nxge/xgehal/xgehal-stats.c optional nxge
dev/nxge/xgehal/xgehal-driver.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-ring.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-channel.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-fifo.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-stats.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nxge/xgehal/xgehal-config.c optional nxge
dev/nxge/xgehal/xgehal-mgmt.c optional nxge
dev/nxge/xgehal/xgehal-mgmt.c optional nxge \
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}"
dev/nmdm/nmdm.c optional nmdm
dev/nsp/nsp.c optional nsp
dev/nsp/nsp_pccard.c optional nsp pccard
@ -3478,7 +3486,7 @@ gnu/fs/xfs/FreeBSD/xfs_sysctl.c optional xfs \
gnu/fs/xfs/FreeBSD/xfs_fs_subr.c optional xfs \
compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
gnu/fs/xfs/FreeBSD/xfs_ioctl.c optional xfs \
compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
gnu/fs/xfs/FreeBSD/support/debug.c optional xfs \
compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
gnu/fs/xfs/FreeBSD/support/ktrace.c optional xfs \

View File

@ -21,6 +21,7 @@ NO_WARRAY_BOUNDS= -Wno-array-bounds
NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative
NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow
NO_WUNUSED_VALUE= -Wno-unused-value
NO_WSELF_ASSIGN= -Wno-self-assign
# Several other warnings which might be useful in some cases, but not severe
# enough to error out the whole kernel build. Display them anyway, so there is
# some incentive to fix them eventually.

View File

@ -26,3 +26,8 @@ CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP
#
.include <bsd.kmod.mk>
CWARNFLAGS.fil.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.ip_proxy.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.ip_lookup.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}

View File

@ -39,3 +39,13 @@ SRCS+= xgehal-mgmt.c
SRCS+= device_if.h bus_if.h pci_if.h
.include <bsd.kmod.mk>
CWARNFLAGS.if_nxge.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-device.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-driver.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-ring.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-channel.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-fifo.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-stats.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS.xgehal-mgmt.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}

View File

@ -86,8 +86,5 @@ CFLAGS+= -I${.CURDIR}/../../gnu/fs/xfs/FreeBSD \
-I${.CURDIR}/../../gnu/fs/xfs/FreeBSD/support \
-I${.CURDIR}/../../gnu/fs/xfs
#
# XFS sources trigger missing-prototypes warnings.
# Disable them here.
#
CWARNFLAGS+= -Wno-missing-prototypes
CWARNFLAGS.xfs_ioctl.c= ${NO_WSELF_ASSIGN}
CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}