Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18127

-Werror=array-bounds caused false failure in configure tests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • Lustre 2.16.0
    • None
    • 3
    • 9223372036854775807

    Description

      While building Lustre codes with kernel 5.19.0-45-generic, I found some configure test results were incorrect because "-Werror=array-bounds" caused false failure in those tests. For example:

      build/conftest.c: In function 'main':
      build/conftest.c:228:39: error: array subscript 0 is outside array bounds of 'struct inode_operations[0]' [-Werror=array-bounds]
        228 |         ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
            |                                       ^~
      cc1: all warnings being treated as errors
      

      "-Warray-bounds" was enabled in kernel commit v5.17-rc3-1-ge6148767825c (Makefile: Enable -Warray-bounds), and was disabled in kernel commits:

      • v5.19-rc1-28-gf0be87c42cbd (gcc-12: disable '-Warray-bounds' universally for now)
      • v6.2-rc3-9-g5a41237ad1d4 (gcc: disable -Warray-bounds for gcc-11 too)
      • v6.3-rc7-202-g0da6e5fd6c37 (gcc: disable '-Warray-bounds' for gcc-13 too)

      Attachments

        Activity

          People

            yujian Jian Yu
            yujian Jian Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: