]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
tacacs: Silence flexible array extension warnings
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 7 Feb 2023 21:31:55 +0000 (15:31 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 7 Feb 2023 21:31:55 +0000 (15:31 -0600)
src/protocols/tacacs/tacacs.h

index 56147bc14801f9d83d0255c8f09c54c253823e96..8691145d0dae90dc8ca8ecf2e27ea9e2d7e01c7b 100644 (file)
@@ -256,6 +256,14 @@ typedef struct CC_HINT(__packed__) {
        fr_tacacs_acct_reply_status_t   status:8;
 } fr_tacacs_packet_acct_reply_hdr_t;
 
+/*
+ * Technically the flexible array extensions aren't allowed
+ * but clang and GCC still seem to do the right thing.
+ *
+ * If this ever becomes an issue the code will need to be
+ * refactored.
+ */
+DIAG_OFF(flexible-array-extensions)
 typedef struct CC_HINT(__packed__) {
        fr_tacacs_packet_hdr_t                                  hdr;
        union {
@@ -268,6 +276,7 @@ typedef struct CC_HINT(__packed__) {
                fr_tacacs_packet_acct_reply_hdr_t       acct_reply;
        };
 } fr_tacacs_packet_t;
+DIAG_ON(flexible-array-extensions)
 
 typedef enum {
        FR_TACACS_CODE_INVALID = 0,