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

          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: