[lxc-devel] [lxc/lxc] 6fc7d8: fix some cppcheck warnings

GitHub noreply at github.com
Sun Jul 2 15:47:37 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 6fc7d8b63ee1b44634010d626a6aad175ff6332b
      https://github.com/lxc/lxc/commit/6fc7d8b63ee1b44634010d626a6aad175ff6332b
  Author: 0x0916 <w at laoqinren.net>
  Date:   2017-07-02 (Sun, 02 Jul 2017)

  Changed paths:
    M src/lxc/cgroups/cgfs.c
    M src/lxc/confile.c
    M src/lxc/confile_legacy.c
    M src/lxc/lxclock.c
    M src/lxc/tools/lxc_info.c
    M src/lxc/tools/lxc_top.c

  Log Message:
  -----------
  fix some cppcheck warnings

use cppcheck tools `cppcheck --enable=warning  .` on lxc source directory.

This patch fix the following warnning

```
[src/lxc/cgroups/cgfs.c:794]: (warning) %ld in format string (no. 3) requires 'long' but the argument type is 'unsigned long'.
[src/lxc/confile.c:4441]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile.c:4502]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile_legacy.c:921]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile_legacy.c:938]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/lxclock.c:63]: (warning) %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'size_t {aka unsigned long}'.
[src/lxc/tools/lxc_info.c:118]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:118]: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:123]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:127]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:130]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:212]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:212]: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:217]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:221]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:224]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
```

Signed-off-by: Long Wang <w at laoqinren.net>


  Commit: b51eb5ca3a23adb8edf5f68013fec494dc4d01e7
      https://github.com/lxc/lxc/commit/b51eb5ca3a23adb8edf5f68013fec494dc4d01e7
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-07-02 (Sun, 02 Jul 2017)

  Changed paths:
    M src/lxc/cgroups/cgfs.c
    M src/lxc/confile.c
    M src/lxc/confile_legacy.c
    M src/lxc/lxclock.c
    M src/lxc/tools/lxc_info.c
    M src/lxc/tools/lxc_top.c

  Log Message:
  -----------
  Merge pull request #1667 from 0x0916/2017-07-02/fix-cppcheck-warnings

fix some cppcheck warnings


Compare: https://github.com/lxc/lxc/compare/26b9df9dc74b...b51eb5ca3a23


More information about the lxc-devel mailing list