Browse Source

AP_GPS: use zero length flexible arrays

this works with gcc-6.1 and also works with asan. Hopefully it will
make coverity happy too.
master
Andrew Tridgell 9 years ago
parent
commit
af116d238f
  1. 2
      libraries/AP_GPS/AP_GPS_ERB.h
  2. 2
      libraries/AP_GPS/AP_GPS_MTK.h
  3. 2
      libraries/AP_GPS/AP_GPS_MTK19.h
  4. 2
      libraries/AP_GPS/AP_GPS_SIRF.h
  5. 2
      libraries/AP_GPS/AP_GPS_UBLOX.h

2
libraries/AP_GPS/AP_GPS_ERB.h

@ -90,7 +90,7 @@ private: @@ -90,7 +90,7 @@ private:
erb_stat stat;
erb_dops dops;
erb_vel vel;
uint8_t bytes[1];
uint8_t bytes[0];
} _buffer;
enum erb_protocol_bytes {

2
libraries/AP_GPS/AP_GPS_MTK.h

@ -72,7 +72,7 @@ private: @@ -72,7 +72,7 @@ private:
// Receive buffer
union PACKED {
diyd_mtk_msg msg;
uint8_t bytes[1];
uint8_t bytes[0];
} _buffer;
// Buffer parse & GPS state update

2
libraries/AP_GPS/AP_GPS_MTK19.h

@ -78,6 +78,6 @@ private: @@ -78,6 +78,6 @@ private:
// Receive buffer
union {
diyd_mtk_msg msg;
uint8_t bytes[1];
uint8_t bytes[0];
} _buffer;
};

2
libraries/AP_GPS/AP_GPS_SIRF.h

@ -98,7 +98,7 @@ private: @@ -98,7 +98,7 @@ private:
// Message buffer
union {
sirf_geonav nav;
uint8_t bytes[1];
uint8_t bytes[0];
} _buffer;
bool _parse_gps(void);

2
libraries/AP_GPS/AP_GPS_UBLOX.h

@ -384,7 +384,7 @@ private: @@ -384,7 +384,7 @@ private:
ubx_rxm_rawx rxm_rawx;
#endif
ubx_ack_ack ack;
uint8_t bytes[1];
uint8_t bytes[0];
} _buffer;
enum ubs_protocol_bytes {

Loading…
Cancel
Save