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

Fix Clang build errors

    XMLWordPrintable

Details

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

    Description

      I've been experimenting with using Clang 15.0.6 to compile Lustre. The compiler runs into a number of build issues. Clang seems to be stricter than GCC in a few cases. Lustre can still be compiled by disabling the errors [1], but a first glance the errors seem legitimate. I'm making this ticket because I have a patch to fix some of the failures.

      It seems like some Clang-based static analyzers were used in the past [2], although I'm not sure if compiling Lustre with Clang is super common. I think it could be useful to have Clang as an option for development purposes, along the lines of ClangBuiltLinux [3]. It's seems like some kind of plugin [4] was developed at some point. It would be for an old (3.0) Clang, but it could be interesting to look at.

       

      [1] Errors that needed to be disabled:

       

      -Wno-error=enum-conversion
      -Wno-error=unused-but-set-variable
      -Wno-error=uninitialized
      -Wno-error=format
      -Wno-error=strncat-size
      -Wno-error=switch
      -Wno-error=strlcpy-strlcat-size
      -Wno-error=unneeded-internal-declaration
      -Wno-error=self-assign
      -Wno-error=tautological-constant-out-of-range-compare
      -Wno-error=constant-logical-operand
      -Wno-error=pointer-bool-conversion
      -Wno-error=unused-function
      -Wno-error=parentheses-equality
      -Wno-error=deprecated-non-prototype
      

      [2] Old Clang tickets:

      https://jira.whamcloud.com/browse/LU-871

      https://jira.whamcloud.com/browse/LU-2675

      [3] Clang/Linux: https://clangbuiltlinux.github.io/

      [4] Plugin: https://wiki.whamcloud.com/pages/viewpage.action?pageId=18645101

       

       

      Attachments

        1. sanity-flr.test_42.debug_log.tmp.1679582991.log.bz2
          29.85 MB
          Alex Zhuravlev
        2. serial.txt
          24 kB
          Alex Zhuravlev
        3. stdout.txt
          8 kB
          Alex Zhuravlev

        Issue Links

          Activity

            People

              timday Tim Day
              timday Tim Day
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: