Skip to content

-Warray-bounds warning in dav1d_cli_parse.c on aarch64 Ubuntu SMP

Compiling on aarch64 gives this warning:

../tools/dav1d_cli_parse.c: In function ‘parse_enum.constprop’:
../tools/dav1d_cli_parse.c:218:28: warning: array subscript [2, 2147483648] is outside array bounds of ‘const EnumParseTable[2]’ {aka ‘const struct EnumParseTable[2]’} [-Warray-bounds]
  218 |             if (!tbl[n + 1].str)
      |                  ~~~~~~~~~~^~~~
../tools/dav1d_cli_parse.c:192:29: note: while referencing ‘cpu_mask_tbl’
  192 | static const EnumParseTable cpu_mask_tbl[] = {
      |                             ^~~~~~~~~~~~

System information:

$ uname -srvmo
Linux 5.4.0-1037-aws #39-Ubuntu SMP Thu Jan 14 02:53:31 UTC 2021 aarch64 GNU/Linux
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information