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

incorrect integer format string used for short type

Details

    • Bug
    • Resolution: Fixed
    • Trivial
    • Lustre 2.8.0
    • Lustre 2.7.0
    • None
    • Build on Ubuntu 15.04, static analysis check build with current cppcheck
    • 4
    • 9223372036854775807

    Description

      cppcheck found an incorrect format string being used for a short type:

      Checking lustre/quota/lquota_entry.c...
      [lustre/quota/lquota_entry.c:219]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'short'.

      struct lquota_site *lquota_site_alloc(const struct lu_env *env, void *parent,
      bool is_master, short qtype,
      struct lquota_entry_operations *ops)
      ...

      sprintf(hashname, "LQUOTA_HASH%u", qtype);

      needs to be %hu (or %hd)

      Attachments

        Activity

          [LU-6539] incorrect integer format string used for short type
          adilger Andreas Dilger made changes -
          Severity Original: 1 [ 10020 ] New: 4 [ 10023 ]
          pjones Peter Jones made changes -
          Fix Version/s New: Lustre 2.8.0 [ 11113 ]
          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: