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

rocky 9.5 compile error: ptlrpc/nrs_orr.c

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Compiling master on Rocky 9.5 on aarch64:

      make[3]: Entering directory '/home/vagrant/kernel/rpmbuild/BUILD/kernel-5.14.0-503.33.1.el9_5/linux-5.14.0-503.33.1_lustre.el9.aarch64'
        CC [M]  /home/vagrant/src/lustre-release/lustre/ptlrpc/nrs_orr.o
      /home/vagrant/src/lustre-release/lustre/ptlrpc/nrs_orr.c: In function ‘nrs_orr_supp2str’:
      /home/vagrant/src/lustre-release/lustre/ptlrpc/nrs_orr.c:1680:1: error: control reaches end of non-void function [-Werror=return-type]
      

      Attachments

        Issue Links

          Activity

            [LU-18916] rocky 9.5 compile error: ptlrpc/nrs_orr.c

            "Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58760
            Subject: LU-18916 ptlrpc: fix rocky 9.5 compile error in nrs_orr.c
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: f2d51e3ba1f7732e4156eb783008edb08f2d4696

            gerrit Gerrit Updater added a comment - "Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58760 Subject: LU-18916 ptlrpc: fix rocky 9.5 compile error in nrs_orr.c Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: f2d51e3ba1f7732e4156eb783008edb08f2d4696
            timday Tim Day added a comment -

            No strong preference, but if we move the LBUG() to the start again - we'll need to explicitly tag it with fallthrough;

            timday Tim Day added a comment - No strong preference, but if we move the LBUG() to the start again - we'll need to explicitly tag it with fallthrough;

            It's because the "default: LBUG()" cases were moved from the start of the switch to the end, and some compilers don't understand that LBUG() is a terminal function.

            Options to fix nrs_orr_supp2str() include:

            • moving the "default: LBUG" case to the start again, so it "falls through" (in the compiler's limited viewpoint) to the next case and returns something
            • having "return "unknown";" after LBUG() so that something appears to return from the function even if it never gets called. that might in turn generate "unreachable code" warnings by some static checkers.
            adilger Andreas Dilger added a comment - It's because the " default: LBUG() " cases were moved from the start of the switch to the end, and some compilers don't understand that LBUG() is a terminal function. Options to fix nrs_orr_supp2str() include: moving the " default: LBUG " case to the start again, so it "falls through" (in the compiler's limited viewpoint) to the next case and returns something having " return "unknown"; " after LBUG() so that something appears to return from the function even if it never gets called. that might in turn generate "unreachable code" warnings by some static checkers.
            rread Robert Read added a comment -

            Appears to have been introduced by commit f7b1fea6bf.

            rread Robert Read added a comment - Appears to have been introduced by commit f7b1fea6bf .

            People

              wc-triage WC Triage
              rread Robert Read
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: