svn commit: r357348 - in projects/clang1000-import/sys: conf modules/tpm
Dimitry Andric
dim at FreeBSD.org
Fri Jan 31 19:35:22 UTC 2020
Author: dim
Date: Fri Jan 31 19:35:21 2020
New Revision: 357348
URL: https://svnweb.freebsd.org/changeset/base/357348
Log:
Disable new clang 10.0.0 warnings about converting the result of shift
operations to a boolean in tpm(4):
sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '<<' to a boolean; did you mean '(1 << (0)) != 0'? [-Werror,-Wint-in-bool-context]
WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
^
sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
#define TPM_CRB_CTRL_CANCEL_CMD BIT(0)
^
sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
#define BIT(x) (1 << (x))
^
Such warnings can be useful in C++ contexts, but not so much in kernel
drivers, where this type of bit twiddling is commonplace. So disable it
for this case.
MFC after: 3 days
Modified:
projects/clang1000-import/sys/conf/files.amd64
projects/clang1000-import/sys/conf/kern.mk
projects/clang1000-import/sys/modules/tpm/Makefile
Modified: projects/clang1000-import/sys/conf/files.amd64
==============================================================================
--- projects/clang1000-import/sys/conf/files.amd64 Fri Jan 31 19:06:49 2020 (r357347)
+++ projects/clang1000-import/sys/conf/files.amd64 Fri Jan 31 19:35:21 2020 (r357348)
@@ -323,7 +323,8 @@ dev/syscons/scvesactl.c optional sc vga vesa
dev/syscons/scvgarndr.c optional sc vga
dev/tpm/tpm.c optional tpm
dev/tpm/tpm20.c optional tpm
-dev/tpm/tpm_crb.c optional tpm acpi
+dev/tpm/tpm_crb.c optional tpm acpi \
+ compile-with "${NORMAL_C} ${NO_WINT_IN_BOOL_CONTEXT}"
dev/tpm/tpm_tis.c optional tpm acpi
dev/tpm/tpm_acpi.c optional tpm acpi
dev/tpm/tpm_isa.c optional tpm isa
Modified: projects/clang1000-import/sys/conf/kern.mk
==============================================================================
--- projects/clang1000-import/sys/conf/kern.mk Fri Jan 31 19:06:49 2020 (r357347)
+++ projects/clang1000-import/sys/conf/kern.mk Fri Jan 31 19:35:21 2020 (r357348)
@@ -37,6 +37,9 @@ CWARNEXTRA+= -Wno-error-shift-negative-value
.if ${COMPILER_VERSION} >= 40000
CWARNEXTRA+= -Wno-address-of-packed-member
.endif
+.if ${COMPILER_VERSION} >= 100000
+NO_WINT_IN_BOOL_CONTEXT= -Wno-int-in-bool-context
+.endif
.endif
.if ${COMPILER_TYPE} == "gcc"
Modified: projects/clang1000-import/sys/modules/tpm/Makefile
==============================================================================
--- projects/clang1000-import/sys/modules/tpm/Makefile Fri Jan 31 19:06:49 2020 (r357347)
+++ projects/clang1000-import/sys/modules/tpm/Makefile Fri Jan 31 19:35:21 2020 (r357348)
@@ -11,3 +11,5 @@ SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_i
SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h
.include <bsd.kmod.mk>
+
+CWARNFLAGS.tpm_crb.c+= ${NO_WINT_IN_BOOL_CONTEXT}
More information about the svn-src-projects
mailing list