[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] kdd: remove zero-length arrays



Am Tue, 9 Jun 2020 13:15:49 +0100
schrieb Tim Deegan <tim@xxxxxxx>:

> Olaf, can you try dropping the 'payload' field from the header and replacing 
> the payload[0] in pkt with payload[] ?

In file included from kdd.c:53:
kdd.h:325:17: error: flexible array member in union
  325 |         uint8_t payload[];

--- orig/kdd.h  2020-06-08 17:40:05.000000000 +0000
+++ kdd.h       2020-06-09 13:20:36.724887538 +0000
@@ -68,7 +68,6 @@
     uint16_t len;     /* Payload length, excl. header and trailing byte */
     uint32_t id;      /* Echoed in responses */
     uint32_t sum;     /* Unsigned sum of all payload bytes */
-    uint8_t payload[0];
 } PACKED kdd_hdr;
 
 #define KDD_PKT_CMD 0x0002      /* Debugger commands (and replies to them) */
@@ -323,7 +322,7 @@
         kdd_msg msg;
         kdd_reg reg;
         kdd_stc stc;
-        uint8_t payload[0];
+        uint8_t payload[];
     };
 } PACKED kdd_pkt;
 

Olaf

Attachment: pgpPCjiNOWDDH.pgp
Description: Digitale Signatur von OpenPGP


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.