Skip to content

Commit 24924f6

Browse files
CTS-SAT-1: Ignore pedantic warning on zero-length arrays in libcsp
1 parent 26cfc4b commit 24924f6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/csp/csp_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,16 @@ typedef struct {
229229
csp_buffer_init(), and can later be accessed by csp_buffer_data_size()
230230
*/
231231
union {
232+
#pragma GCC diagnostic push
233+
#pragma GCC diagnostic ignored "-Wpedantic"
234+
232235
/** Access data as uint8_t. */
233236
uint8_t data[0];
234237
/** Access data as uint16_t */
235238
uint16_t data16[0];
236239
/** Access data as uint32_t */
237240
uint32_t data32[0];
241+
#pragma GCC diagnostic pop
238242
};
239243
} csp_packet_t;
240244
//doc-end:csp_packet_t

include/csp/interfaces/csp_if_i2c.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ typedef struct i2c_frame_s {
5656
uint8_t len_rx;
5757
//! Length of \a data part (-> csp_packet_t.length)
5858
uint16_t len;
59+
60+
#pragma GCC diagnostic push
61+
#pragma GCC diagnostic ignored "-Wpedantic"
5962
//! CSP id + data (-> csp_packet_t.id)
6063
uint8_t data[0];
64+
#pragma GCC diagnostic pop
6165
} csp_i2c_frame_t;
6266
//doc-end:csp_i2c_frame_t
6367

0 commit comments

Comments
 (0)