aboutsummaryrefslogtreecommitdiff
path: root/share/mk/bsd.sys.mk
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-02-14 19:48:47 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-02-14 19:48:47 +0000
commit2f6a842484675bb8fe9fafd40d90c06f13e02403 (patch)
tree47fb216f37991f69475df21d019dec4726425c09 /share/mk/bsd.sys.mk
parent047eec4966e36dc2175d82e18683a928faafeb26 (diff)
downloadsrc-2f6a842484675bb8fe9fafd40d90c06f13e02403.tar.gz
src-2f6a842484675bb8fe9fafd40d90c06f13e02403.zip
Disable -Wreturn-type on GCC.
GCC is more pedantic than clang about warning when a function doesn't handle undefined enum values (see GCC bug 87950). Clang's warning gives a more pragmatic coverage and should find any real bugs, so disable the warning for GCC rather than adding __unreachable annotations to appease GCC. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D34147
Diffstat (limited to 'share/mk/bsd.sys.mk')
-rw-r--r--share/mk/bsd.sys.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 694cc66c3f18..cf48411d3d4d 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -206,6 +206,10 @@ CWARNFLAGS+= -Wno-error=overflow
.endif
.endif
+# GCC produces false positives for functions that switch on an
+# enum (GCC bug 87950)
+CWARNFLAGS+= -Wno-return-type
+
# GCC's own arm_neon.h triggers various warnings
.if ${MACHINE_CPUARCH} == "aarch64"
CWARNFLAGS+= -Wno-system-headers