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

too many arguments in a format string in lustre tests, lustre/tests/flock.c

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • Lustre 2.8.0
    • None
    • None
    • Ubuntu 15.04, cppcheck static anaysis + GCC 4.9.2
    • 3
    • 9223372036854775807

    Description

      Static analysis with cppcheck found the following issue in lustre/tests/flock.c:

      Checking lustre/tests/flock.c...
      [lustre/tests/flock.c:178]: (warning) printf format string requires 0 parameters but 1 is given.

      fd = open(file, O_RDWR|O_CREAT, (mode_t)0666);
      if (fd < 0)

      { printf("error open file: %m\n", file); exit(-1); }

      The %m prints strerror(errno), but there is no %s specifier for the file. I believe a modern version GCC will flag this with a warning too.

      Attachments

        Activity

          [LU-6540] too many arguments in a format string in lustre tests, lustre/tests/flock.c
          pjones Peter Jones added a comment -

          Landed for 2.8

          pjones Peter Jones added a comment - Landed for 2.8

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14815/
          Subject: LU-6540 test: fix no %s specifier for the file
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: fb36d989168ea1794c8c0abb387982f857ed647f

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14815/ Subject: LU-6540 test: fix no %s specifier for the file Project: fs/lustre-release Branch: master Current Patch Set: Commit: fb36d989168ea1794c8c0abb387982f857ed647f

          Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14815
          Subject: LU-6540 test: fix no %s specifier for the file
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 9de143f62ab1991ff5f9ff70dfafaf1728cc1af7

          gerrit Gerrit Updater added a comment - Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14815 Subject: LU-6540 test: fix no %s specifier for the file Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 9de143f62ab1991ff5f9ff70dfafaf1728cc1af7

          People

            dmiter Dmitry Eremin (Inactive)
            colinianking Colin Ian King
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: