Home | History | Annotate | Line # | Download | only in conf
copts.mk revision 1.7.4.1
      1 #	$NetBSD: copts.mk,v 1.7.4.1 2024/07/20 14:26:01 martin 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"
     12 COPTS.pf.c+=		-Wno-error=implicit-fallthrough
     13 COPTS.radeon_cs.c+=	-Wno-error=implicit-fallthrough
     14 COPTS.via_dmablit.c+=	-Wno-error=implicit-fallthrough
     15 .endif
     16 
     17 .if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc" && \
     18     (${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel")
     19 COPTS.linux_machdep.c+=	-Wno-error=unused-but-set-variable
     20 .endif
     21 
     22 .if defined(HAVE_GCC) && ${HAVE_GCC} >= 10 && ${ACTIVE_CC} == "gcc"
     23 COPTS.ath.c+=		-Wno-error=enum-conversion
     24 COPTS.dpt.c+=		${GCC_NO_ADDR_OF_PACKED_MEMBER}
     25 COPTS.ffs_appleufs.c+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
     26 # These are wrong. The code explicitly avoids this case.
     27 COPTS.in_pcb.c+=	${GCC_NO_RETURN_LOCAL_ADDR}
     28 COPTS.in6_pcb.c+=	${GCC_NO_RETURN_LOCAL_ADDR}
     29 # Also seems wrong.
     30 COPTS.magma.c+=		${GCC_NO_MAYBE_UNINITIALIZED}
     31 .endif
     32 
     33 .endif
     34