From: Arran Cudbard-Bell Date: Tue, 7 Feb 2023 21:31:55 +0000 (-0600) Subject: tacacs: Silence flexible array extension warnings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11e7e826650eda46b293e2ebe55fc9c7698db9ca;p=thirdparty%2Ffreeradius-server.git tacacs: Silence flexible array extension warnings --- diff --git a/src/protocols/tacacs/tacacs.h b/src/protocols/tacacs/tacacs.h index 56147bc1480..8691145d0da 100644 --- a/src/protocols/tacacs/tacacs.h +++ b/src/protocols/tacacs/tacacs.h @@ -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,