summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuediger Meier2014-05-30 01:18:09 +0200
committerRuediger Meier2014-05-30 01:18:09 +0200
commit60cb2c37201a453a76ea12e4d4b48f7b34ebef2c (patch)
tree85ffda2c6658fb51db06b8363feecd4e39cb3879
parentlslogins: fix pretty-print columns (diff)
downloadkernel-qcow2-util-linux-60cb2c37201a453a76ea12e4d4b48f7b34ebef2c.tar.gz
kernel-qcow2-util-linux-60cb2c37201a453a76ea12e4d4b48f7b34ebef2c.tar.xz
kernel-qcow2-util-linux-60cb2c37201a453a76ea12e4d4b48f7b34ebef2c.zip
build: fix some compiler warnings
Most of them catched on 32bit gcc and icc. disk-utils/fsck.cramfs.c: printf format type lib/boottime.c: unused variables misc-utils/cal.c: set but never used sys-utils/losetup.c: set but never used sys-utils/lscpu-dmi.c: defined but not used sys-utils/switch_root.c: comparison between signed and unsigned tests/helpers/test_sysinfo.c: printf format type
-rw-r--r--disk-utils/fsck.cramfs.c4
-rw-r--r--lib/boottime.c5
-rw-r--r--misc-utils/cal.c2
-rw-r--r--sys-utils/losetup.c2
-rw-r--r--sys-utils/lscpu-dmi.c2
-rw-r--r--sys-utils/switch_root.c3
-rw-r--r--tests/helpers/test_sysinfo.c2
7 files changed, 11 insertions, 9 deletions
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index d4967dccb..6adfa3334 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -618,11 +618,11 @@ static void test_fs(int start)
if (start_data != ~0UL) {
if (start_data < (sizeof(struct cramfs_super) + start))
errx(FSCK_EX_UNCORRECTED,
- _("directory data start (%ld) < sizeof(struct cramfs_super) + start (%ld)"),
+ _("directory data start (%lu) < sizeof(struct cramfs_super) + start (%zu)"),
start_data, sizeof(struct cramfs_super) + start);
if (end_dir != start_data)
errx(FSCK_EX_UNCORRECTED,
- _("directory data end (%ld) != file data start (%ld)"),
+ _("directory data end (%lu) != file data start (%lu)"),
end_dir, start_data);
}
if (super.flags & CRAMFS_FLAG_FSID_VERSION_2)
diff --git a/lib/boottime.c b/lib/boottime.c
index 335570cc1..a2869a50b 100644
--- a/lib/boottime.c
+++ b/lib/boottime.c
@@ -9,8 +9,11 @@
int get_boot_time(struct timeval *boot_time)
{
+#ifdef CLOCK_BOOTTIME
struct timespec hires_uptime;
- struct timeval lores_uptime, now;
+ struct timeval lores_uptime;
+#endif
+ struct timeval now;
struct sysinfo info;
if (gettimeofday(&now, NULL) != 0) {
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index e763fe140..100426639 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -137,7 +137,6 @@ static void my_putstring(char *s)
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) || defined(HAVE_LIBTERMCAP)
static const char *term="";
-static int Slen; /* strlen of Senter+Sexit */
#endif
static const char *Senter="", *Sexit="";/* enter and exit standout mode */
@@ -304,7 +303,6 @@ int main(int argc, char **argv)
if (ret > 0) {
Senter = my_tgetstr("so","smso");
Sexit = my_tgetstr("se","rmso");
- Slen = strlen(Senter) + strlen(Sexit);
}
}
#endif
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index ecba8a56c..6ad94be4c 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -77,7 +77,6 @@ static struct colinfo infos[] = {
static int columns[NCOLS] = {-1};
static int ncolumns;
-static int verbose;
static int get_column_id(int num)
{
@@ -543,7 +542,6 @@ int main(int argc, char **argv)
showdev = 1;
break;
case 'v':
- verbose = 1;
break;
case 'V':
printf(UTIL_LINUX_VERSION);
diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c
index c82bfc134..251d4acc4 100644
--- a/sys-utils/lscpu-dmi.c
+++ b/sys-utils/lscpu-dmi.c
@@ -168,6 +168,7 @@ done:
return rc;
}
+#if defined(__x86_64__) || defined(__i386__)
static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem)
{
if (!checksum(buf, 0x0F))
@@ -177,6 +178,7 @@ static int hypervisor_decode_legacy(uint8_t *buf, const char *devmem)
WORD(buf + 0x0C),
devmem);
}
+#endif
static int hypervisor_decode_smbios(uint8_t *buf, const char *devmem)
{
diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c
index dac946f8c..6822a5d0c 100644
--- a/sys-utils/switch_root.c
+++ b/sys-utils/switch_root.c
@@ -181,7 +181,8 @@ static int switchroot(const char *newroot)
if (pid <= 0) {
struct statfs stfs;
if (fstatfs(cfd, &stfs) == 0 &&
- (stfs.f_type == STATFS_RAMFS_MAGIC || stfs.f_type == STATFS_TMPFS_MAGIC))
+ (stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC ||
+ stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC))
recursiveRemove(cfd);
else
warn(_("old root filesystem is not an initramfs"));
diff --git a/tests/helpers/test_sysinfo.c b/tests/helpers/test_sysinfo.c
index 3983f28ef..ce7bc081a 100644
--- a/tests/helpers/test_sysinfo.c
+++ b/tests/helpers/test_sysinfo.c
@@ -27,7 +27,7 @@ typedef struct {
static int hlp_wordsize(void)
{
- printf("%lu\n", CHAR_BIT * sizeof(void*));
+ printf("%zu\n", CHAR_BIT * sizeof(void*));
return 0;
}