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
          adilger Andreas Dilger made changes -
          Severity Original: 1 [ 10020 ] New: 3 [ 10022 ]
          pjones Peter Jones made changes -
          Fix Version/s New: Lustre 2.8.0 [ 11113 ]
          pjones Peter Jones made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          dmiter Dmitry Eremin (Inactive) made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          doug Doug Oucharek (Inactive) made changes -
          Assignee Original: WC Triage [ wc-triage ] New: Dmitry Eremin [ dmiter ]
          colinianking Colin Ian King created issue -

          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: