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