[coreboot-gerrit] Patch merged into coreboot/master: 5f3754e inteltool: cpu.c: Use conversion specifier `u` for unsigned integers
gerrit at coreboot.org
gerrit at coreboot.org
Fri Apr 5 20:17:04 CEST 2013
the following patch was just integrated into master:
commit 5f3754e66dbe3b04c71c19fb106a92b30d475ab4
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date: Fri Apr 5 00:12:21 2013 +0200
inteltool: cpu.c: Use conversion specifier `u` for unsigned integers
Cppcheck [1], a static code analysis tool, warns about the
following.
$ cppcheck --version
Cppcheck 1.59
$ cppcheck --enable=all .
[…]
Checking cpu.c...
[cpu.c:951]: (warning) %d in format string (no. 1) requires a signed integer given in the argument list.
[cpu.c:962]: (warning) %d in format string (no. 1) requires a signed integer given in the argument list.
[…]
And indeed, `core` is an unsigned integer and `man 3 printf` tells
the following about conversion specifiers.
d, i The int argument is converted to signed decimal notation. […]
o, u, x, X
The unsigned int argument is converted to unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X)
notation.
So use `u` and Cppcheck does not complain anymore.
[1] http://cppcheck.sourceforge.net/
Change-Id: If8dd8d0efe75fcb4af2502ae5100e3f2062649e4
Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3026
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
Build-Tested: build bot (Jenkins) at Fri Apr 5 11:17:22 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer at coreboot.org> at Fri Apr 5 20:17:03 2013, giving +2
See http://review.coreboot.org/3026 for details.
-gerrit
More information about the coreboot-gerrit
mailing list