particle-iot / gps-ublox

Support for u-blox NEO-M8U with paired NMEA parser
Apache License 2.0
5 stars 2 forks source link

Fix GCC 10 flexible array build errors #6

Closed eberseth closed 3 years ago

eberseth commented 3 years ago

Problem

Flexible arrays in ubx_log_string_t and ubx_mga_flash_write_t structures cause a build error with GCC 10 because they are wrapped and followed by another array, which violates the basic principle that the flexible array must be the last element.

Solution

Change wrapping structures to unions and fool compiler into ignoring the violation.