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

          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: