diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h index 3e8fe6fb3558..2d71de51ede4 100644 --- a/sys/contrib/dev/acpica/include/actypes.h +++ b/sys/contrib/dev/acpica/include/actypes.h @@ -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 */ diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile index a425d4014f58..493f2b897d06 100644 --- a/usr.sbin/acpi/acpidb/Makefile +++ b/usr.sbin/acpi/acpidb/Makefile @@ -80,3 +80,7 @@ CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing LIBADD= pthread .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 +CWARNFLAGS+= -Wno-null-pointer-arithmetic +.endif