xref: /netbsd-src/sys/conf/copts.mk (revision 2718af68c3efc72c9769069b5c7f9ed36f6b9def)
1#	$NetBSD: copts.mk,v 1.6 2021/04/12 06:08:31 mrg Exp $
2
3# MI per-file compiler options required.
4
5# Use -Wno-error=foo when the ultimate goal is to fix this warning
6# with code change, and use -Wno-foo when the warning is bad.
7
8.ifndef _SYS_CONF_COPTS_MK_
9_SYS_CONF_COPTS_MK_=1
10
11.if defined(HAVE_GCC) && ${HAVE_GCC} >= 7 && ${ACTIVE_CC} == "gcc"
12COPTS.zlib.c+=		-Wno-error=implicit-fallthrough
13COPTS.pf.c+=		-Wno-error=implicit-fallthrough
14COPTS.radeon_cs.c+=	-Wno-error=implicit-fallthrough
15COPTS.via_dmablit.c+=	-Wno-error=implicit-fallthrough
16.endif
17
18.if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc" && \
19    (${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel")
20COPTS.linux_machdep.c+=	-Wno-error=unused-but-set-variable
21.endif
22
23.if defined(HAVE_GCC) && ${HAVE_GCC} >= 10 && ${ACTIVE_CC} == "gcc"
24COPTS.ath.c+=		-Wno-error=enum-conversion
25COPTS.dpt.c+=		${GCC_NO_ADDR_OF_PACKED_MEMBER}
26COPTS.ffs_appleufs.c+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
27# These are wrong. The code explicitly avoids this ase.
28COPTS.in_pcb.c+=	${GCC_NO_RETURN_LOCAL_ADDR}
29COPTS.in6_pcb.c+=	${GCC_NO_RETURN_LOCAL_ADDR}
30# Also seems wrong.
31COPTS.magma.c+=		${GCC_NO_MAYBE_UNINITIALIZED}
32.endif
33
34.endif
35