[PATCH 3/7] Wrap ACPI_ROOT_OBJECT with PRAGMA_NULL_PTR_MATH for clang builds
Colin King
colin.king at canonical.com
Mon Jul 30 18:30:55 UTC 2018
From: Colin Ian King <colin.king at canonical.com>
The ACPI_ROOT_OBJECT uses a gcc-ism with null pointer arithmetic
which makes clang choke, so add a pragma to disable this warning
for non-gcc builds.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpi/madt/madt.c | 3 +++
src/sbbr/acpitables/acpitables.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index 883d5847..bd2669b6 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -401,8 +401,11 @@ static int madt_init(fwts_framework *fw)
if (fwts_acpica_init(fw) != FWTS_OK)
return FWTS_ERROR;
+PRAGMA_PUSH
+PRAGMA_NULL_PTR_MATH
AcpiWalkNamespace(0x0c, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
madt_processor_handler, NULL, NULL, NULL);
+PRAGMA_POP
AcpiGetDevices("ACPI0007", madt_processor_handler, NULL, NULL);
return (spec_data) ? FWTS_OK : FWTS_ERROR;
diff --git a/src/sbbr/acpitables/acpitables.c b/src/sbbr/acpitables/acpitables.c
index d40c164d..72ce743c 100644
--- a/src/sbbr/acpitables/acpitables.c
+++ b/src/sbbr/acpitables/acpitables.c
@@ -98,9 +98,12 @@ static int acpi_table_sbbr_namespace_check_test1(fwts_framework *fw)
if (fwts_acpica_init(fw) != FWTS_OK)
return FWTS_ERROR;
+PRAGMA_PUSH
+PRAGMA_NULL_PTR_MATH
/* Searching for all processor devices in the namespace. */
AcpiWalkNamespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
processor_handler, NULL, NULL, (void **)&error_count);
+PRAGMA_POP
/* Deinitializing ACPICA, if we don't call this the terminal will break on exit. */
fwts_acpica_deinit();
--
2.17.1
More information about the fwts-devel
mailing list