From f77fc690c76430bb855bf81bb52157208226bc97 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 18 Jun 2020 14:52:18 -0700 Subject: [PATCH] hott:Fix compiler error array bound is unknown This fixes error: variable-length array bound is unknown [-Werror=vla-larger-than=] with gcc 9.1 --- src/drivers/telemetry/hott/hott_sensors/hott_sensors.cpp | 2 +- src/drivers/telemetry/hott/hott_telemetry/hott_telemetry.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/telemetry/hott/hott_sensors/hott_sensors.cpp b/src/drivers/telemetry/hott/hott_sensors/hott_sensors.cpp index 9986073408..c6c7f0c7a0 100644 --- a/src/drivers/telemetry/hott/hott_sensors/hott_sensors.cpp +++ b/src/drivers/telemetry/hott/hott_sensors/hott_sensors.cpp @@ -89,7 +89,7 @@ send_poll(int uart, uint8_t *buffer, size_t size) /* A hack the reads out what was written so the next read from the receiver doesn't get it. */ /* TODO: Fix this!! */ - uint8_t dummy[size]; + uint8_t dummy[MAX_MESSAGE_BUFFER_SIZE]; read(uart, &dummy, size); return OK; diff --git a/src/drivers/telemetry/hott/hott_telemetry/hott_telemetry.cpp b/src/drivers/telemetry/hott/hott_telemetry/hott_telemetry.cpp index 8a85877eec..43a2ea5995 100644 --- a/src/drivers/telemetry/hott/hott_telemetry/hott_telemetry.cpp +++ b/src/drivers/telemetry/hott/hott_telemetry/hott_telemetry.cpp @@ -157,7 +157,7 @@ send_data(int uart, uint8_t *buffer, size_t size) /* A hack the reads out what was written so the next read from the receiver doesn't get it. */ /* TODO: Fix this!! */ - uint8_t dummy[size]; + uint8_t dummy[MAX_MESSAGE_BUFFER_SIZE]; read(uart, &dummy, size); return PX4_OK;