X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/35c0995dde0c37486681630acdd8d26659a4732e..aa02ed367404c659ab7205ef9662ef92032d7786:/symm/square.c?ds=sidebyside diff --git a/symm/square.c b/symm/square.c index f3056de..73b22bb 100644 --- a/symm/square.c +++ b/symm/square.c @@ -92,10 +92,26 @@ void square_init(square_ctx *k, const void *buf, size_t sz) } nr = 8; + /* --- GCC complains about an out-of-bounds subscript here --- * + * + * This is impossible. Thanks to @KSZ_ASSERT@, we know that @sz <= 16@ and + * hence @i <= nk <= 4@; but @SQUARE_KWORDS == 36@. + */ + +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif + + ww = kk[i - 1]; + +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# pragma GCC diagnostic pop +#endif + /* --- Expand this material to fill the rest of the table --- */ nw = (nr + 1) * 4; - ww = kk[i - 1]; p = RCON; for (; i < nw; i++) { uint32 w = kk[i - nk];