fix gps: remove Wno-cast-align & fix it

This commit is contained in:
Beat Küng
2021-08-18 12:24:17 -04:00
committed by Daniel Agar
parent 4b49f9261e
commit 7b9d16d2f8
2 changed files with 4 additions and 2 deletions
-1
View File
@@ -37,7 +37,6 @@ px4_add_module(
MODULE drivers__gps
MAIN gps
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
-Wno-stringop-overflow # due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91707
SRCS
gps.cpp
+4 -1
View File
@@ -46,6 +46,7 @@
#endif
#include <termios.h>
#include <cstring>
#include <drivers/drv_sensor.h>
#include <lib/drivers/device/Device.hpp>
@@ -362,7 +363,9 @@ int GPS::callback(GPSCallbackType type, void *data1, int data2, void *user)
switch (type) {
case GPSCallbackType::readDeviceData: {
int num_read = gps->pollOrRead((uint8_t *)data1, data2, *((int *)data1));
int timeout;
memcpy(&timeout, data1, sizeof(timeout));
int num_read = gps->pollOrRead((uint8_t *)data1, data2, timeout);
if (num_read > 0) {
gps->dumpGpsData((uint8_t *)data1, (size_t)num_read, gps_dump_comm_mode_t::Full, false);