treewide: Prefer flexible arrays to zero-length arrays

https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
This commit is contained in:
Denis Kenzior 2023-04-13 21:36:14 -05:00
parent e0ea324f77
commit b42923dc5d
4 changed files with 12 additions and 12 deletions

View File

@ -73,7 +73,7 @@ struct mschapv2_response {
/* This will always be sizeof(value) */
uint8_t val_length;
struct mschapv2_value value;
char name[0];
char name[];
} __attribute__((packed));
/**

View File

@ -334,7 +334,7 @@ struct mmpdu_field_capability {
struct mmpdu_association_request {
struct mmpdu_field_capability capability;
__le16 listen_interval;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.6 */
@ -342,7 +342,7 @@ struct mmpdu_association_response {
struct mmpdu_field_capability capability;
__le16 status_code;
__le16 aid;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.7 */
@ -350,7 +350,7 @@ struct mmpdu_reassociation_request {
struct mmpdu_field_capability capability;
__le16 listen_interval;
unsigned char current_ap_address[6];
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.8 */
@ -358,13 +358,13 @@ struct mmpdu_reassociation_response {
struct mmpdu_field_capability capability;
__le16 status_code;
__le16 aid;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.4 */
struct mmpdu_disassociation {
__le16 reason_code;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.9 */
@ -377,14 +377,14 @@ struct mmpdu_probe_response {
__le64 timestamp;
__le16 beacon_interval;
struct mmpdu_field_capability capability;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.15 */
struct mmpdu_timing_advertisement {
__le64 timestamp;
struct mmpdu_field_capability capability;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.2 */
@ -392,7 +392,7 @@ struct mmpdu_beacon {
__le64 timestamp;
__le16 beacon_interval;
struct mmpdu_field_capability capability;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
/* 802.11, Section 8.3.3.11 */
@ -406,7 +406,7 @@ struct mmpdu_authentication {
/* 802.11, Section 8.3.3.12 */
struct mmpdu_deauthentication {
__le16 reason_code;
uint8_t ies[0];
uint8_t ies[];
} __attribute__ ((packed));
const struct mmpdu_header *mpdu_validate(const uint8_t *frame, int len);

View File

@ -99,7 +99,7 @@ struct netdev_handshake_state {
struct netdev_ext_key_info {
uint16_t proto;
bool noencrypt;
struct eapol_frame frame[0];
struct eapol_frame frame[];
};
struct netdev {

View File

@ -138,7 +138,7 @@ struct rrm_beacon_report {
uint8_t bssid[6];
uint8_t antenna_id;
__le32 parent_tsf;
uint8_t subelements[0];
uint8_t subelements[];
} __attribute__ ((packed));
static struct l_queue *states;