Revert r327338, undoing the changes to the ACPI_ADD_PTR and ACPI_SUB_PTR

macros.  Instead, turn off clang 6.0.0 warnings about null pointer
arithmetic in usr.sbin/acpi/acpidb instead.
This commit is contained in:
Dimitry Andric 2018-01-06 15:52:21 +00:00
parent a1ba34d4a7
commit ec2bf1e7b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang600-import/; revision=327622
2 changed files with 6 additions and 2 deletions

View File

@ -651,8 +651,8 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p))
#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p))
#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_UINTPTR_T) (a) + (ACPI_SIZE)(b))
#define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_UINTPTR_T) (a) - (ACPI_SIZE)(b))
#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b)))
#define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
#define ACPI_PTR_DIFF(a, b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b)))
/* Pointer/Integer type conversions */

View File

@ -80,3 +80,7 @@ CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing
LIBADD= pthread
.include <bsd.prog.mk>
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000
CWARNFLAGS+= -Wno-null-pointer-arithmetic
.endif